|
26601
|
1103
|
3
|
2026-05-12T12:46:22.439157+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778589982439_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.97706115,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.98836434,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.55485374,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.56349736,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5744681,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5831117,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.59175533,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.60272604,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.6136968,"top":0.074221864,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.6402925,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6512633,"top":0.074221864,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4047971890534061470
|
-7130532267568195324
|
app_switch
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26602
|
1103
|
4
|
2026-05-12T12:46:23.448424+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778589983448_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.97706115,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.98836434,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.55485374,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.56349736,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5744681,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5831117,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.59175533,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.60272604,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.6136968,"top":0.074221864,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.6402925,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6512633,"top":0.074221864,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"bounds":{"left":0.9481383,"top":0.074221864,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9431516,"top":0.09896249,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.953125,"top":0.09896249,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"bounds":{"left":0.9624335,"top":0.09896249,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9737367,"top":0.09736632,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98105055,"top":0.09736632,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
26601
|
NULL
|
NULL
|
NULL
|
|
26603
|
1102
|
3
|
2026-05-12T12:46:52.603837+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590012603_m1.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
26600
|
NULL
|
NULL
|
NULL
|
|
26604
|
1103
|
5
|
2026-05-12T12:46:53.799255+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590013799_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.97706115,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.98836434,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.55485374,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.56349736,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5744681,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5831117,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.59175533,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.60272604,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.6136968,"top":0.074221864,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.6402925,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6512633,"top":0.074221864,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"bounds":{"left":0.9481383,"top":0.074221864,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9431516,"top":0.09896249,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.953125,"top":0.09896249,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"bounds":{"left":0.9624335,"top":0.09896249,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9737367,"top":0.09736632,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98105055,"top":0.09736632,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26605
|
1102
|
4
|
2026-05-12T12:47:22.865928+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590042865_m1.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26606
|
1103
|
6
|
2026-05-12T12:47:24.154495+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590044154_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.97706115,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.98836434,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.55485374,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.56349736,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5744681,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5831117,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.59175533,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.60272604,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.6136968,"top":0.074221864,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.6402925,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6512633,"top":0.074221864,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"bounds":{"left":0.9481383,"top":0.074221864,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9431516,"top":0.09896249,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.953125,"top":0.09896249,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"bounds":{"left":0.9624335,"top":0.09896249,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9737367,"top":0.09736632,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98105055,"top":0.09736632,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
26604
|
NULL
|
NULL
|
NULL
|
|
26607
|
1102
|
5
|
2026-05-12T12:47:27.252287+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590047252_m1.jpg...
|
Claude
|
Claude
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error
Last swimming outing with Dani
More options for Last swimming outing with Dani
Lukas Pro
Get apps and extensions
Screenpipe data sync and retention management, rename chat
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Close...
|
[{"role":"AXLink","text":& [{"role":"AXLink","text":"Skip to content","depth":14,"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Skip to content","depth":15,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Click to collapse","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"⌘B","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Drag to resize","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Collapse sidebar","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cowork","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New chat ⌘N","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"New chat","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"⌘N","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Projects","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Artifacts","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Customize","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Pinned","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Bulgarian citizenship application process for EU residents","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Bulgarian citizenship application process for EU residents","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Dawarich location tracking project","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Dawarich location tracking project","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Recents","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"View all","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe data sync and retention management","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe data sync and retention management","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync script failing after recent migrations","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync script failing after recent migrations","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hubspot BadRequest headers debugging","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Hubspot BadRequest headers debugging","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Monthly expense tracking","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Monthly expense tracking","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Exporting transaction data from Notion to finance hub","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Exporting transaction data from Notion to finance hub","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 How much have I spent for groc…","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 How much have I spent for groc…","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"April 2026 spending by category","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for April 2026 spending by category","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code diff review","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Code diff review","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit implementation strategy","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit implementation strategy","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe retention policy code location","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe retention policy code location","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Viewing retention policy in screenpipe","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Viewing retention policy in screenpipe","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Clean shot x video recording termination issue","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Clean shot x video recording termination issue","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit handling with executeRequest","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit handling with executeRequest","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Untitled","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 Screen pipe. Is there ability…","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 Screen pipe. Is there ability…","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"SMB mount access inconsistency between Finder and iTerm","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for SMB mount access inconsistency between Finder and iTerm","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 What is the best switch I can…","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 What is the best switch I can…","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Permission denied on screenpipe volume","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Permission denied on screenpipe volume","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync database attachment error","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync database attachment error","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Last swimming outing with Dani","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Last swimming outing with Dani","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"Lukas Pro","depth":15,"bounds":{"left":0.49097222,"top":0.0,"width":0.08055556,"height":0.026666667},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Get apps and extensions","depth":15,"bounds":{"left":0.6576389,"top":0.0,"width":0.016666668,"height":0.026666667},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe data sync and retention management, rename chat","depth":19,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Screenpipe data sync and retention management","depth":21,"on_screen":true,"role_description":"text"},{"role":"AXPopUpButton","text":"More options for Screenpipe data sync and retention management","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-2465615769038738784
|
1300132490362445333
|
app_switch
|
hybrid
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error
Last swimming outing with Dani
More options for Last swimming outing with Dani
Lukas Pro
Get apps and extensions
Screenpipe data sync and retention management, rename chat
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Close
SlackFileEditViewGoHistoryWindowHelp(ab)Retro - Platform • in 1h 13 msshDOCKER• 81DEV (-zsh)О ₴2APP (-zsh)• *[EMAIL]@Lukas-Kovaliks-MacBook-Pro-Jiminny~/.screenpipe/data $ cd ..[EMAIL] $ nasAdm1n@DXP4800PLUS-B5F8: ~$cd/volumel/screenpipe/Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes 1ltotal26Gdrwxrwxrwx+1rootroot410 May1215:15drwxr-xr-xrootroot450 Apr2519:39drwxrwxrwx+1Adminadmin202 Apr2620:10drwxrwxrwx+1Adminadmin298 May1013:46drwxrwxrwx+Adminadmin144 May09:41drwxrwxrwx+1Admin admin70 May1013:47drwxrwxrwx+1Adminadmin164 Apr1116:51drwxrwxrwx+1rootroot5.1KMay1120:55-rwxrwxrwx+1rootroot31Apr1817:42app_settings.json1Adminadmin13G May1120:55archive.db-rwxrwxrwx+1Adminadmin11G May10-rwxrwxrwx+Admin admin 3.5G May1112:31archive.db-bak20:15db.sqlite-rwxrwxrwx+1Admin admin32K May1205:48db.sqlite-shm-rwxrwxrwx+ 1Admin admin0 Apr 26 17:17db.sqlite-wal1Admin admin11K May 12 09:09.DS_Store-rwxrwxrwx+ 1 Admin admin219 Apr24 19:33•gitignore-rwxrwxrWx+1 Admin admin0 Apr1317:21screenpipe.db-rwxrwxrwx+1 Admin admin 8.4K May12 15:15screenpipe_fts_migrate.sh-rwxrwxrwx+ 1 Admin admin32K May 11 20:48screenpipe_sync.sh-rwxrwxrwx+ 1 Admin admin20K May 10 13:06screenpipe_sync_updated.shAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe$ cp archive.dbarchive.db.bak-pre-installidAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes ./screenpipe_fts_migrate.sh archive.dbScreenpipe FTS migrationDB:archive.dbSize: 13G• ×4-zsh• 285screenpipe"O 886ssh100% <78•Tue 12 May 15:47:2618187-zsh• *8+• Creating install registry_installs table• Om01s• Adding install_id to base tablesvideo_chunksalready presentError: stepping, UNIQUEconstraintfailed: video_chunks.install_id, video_chunks.id (19)Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT * FROM_installs;"Adm1neDXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT install_id, COUNT(*) FROM frames GROUP BY install_id;"Error: in prepare, no such column: install_idSELECT install_id,COUNT(*) FROM frames GROUP BY install_id;^_-- error hereAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes |...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26609
|
1103
|
7
|
2026-05-12T12:47:29.930928+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590049930_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormFV faVsco.js vProjectINavicarecode%9 JY-20 PhostormFV faVsco.js vProjectINavicarecode%9 JY-20725-handle-HS-search-rate-limPlaybackController.php© MomentController.ph© NudgeController.php® NumberAllocatorCon© OrganizationLicense:© OrganizationMembero ureanizauonkelenule© OrganizationRolesCoc) Organizationsynccol© PartnerController.phy) Phonenumbercontrc© PlaybackController.p©PlaylistController.phg® ScimController.phpSidekickController.pl© SoftphoneController.c) Ssocontroller.oho© SubscriptionControll 109C) TeamAiAutomatione© TeamAiContextContr 111P TeamController.ohpAutomatedkeponkesuitonpclass keportuoncroller excenas Adstractlontroller(C) TranscriotionControll© TranslationController 115© UserController.php© VocabularyControllerm AuthiCustomerApiInternal~ D Kiosk>D Teams©ActivityController.ph|© AutomatedReportsC, 124© DashboardController© ImpersonationContrc 126© MediaPipelineControOrganizationsContro 128© PartnersController.pt© ProfileController.phpc) Searchcontroller.ohr> D Settings> M Telephonv~ D Webhook• M Hubsoot> D IntegrationAppSubsc 136(C) ActivitvProviderCont© ActivityTranscriptionC) BaseController.oho© CalendarController.pC) RenortController nhoSoftphoneWebhookCC. AbstractController nhnif (Sreport->getReport() ->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) €send the primary revort$this->dispatcher->dispatch(new SendReportJob($reportUuid));// send the podcast report if it set and generatedif (SreportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) €$this-›dispatcher-›dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));// Track Datadog metrics for automated reportsSautomatedReport = $report->getReport();scnis->caLLbackservice->pushlovaradoe caucomareakeport, sreporcif (SreportPodcast) {schis->callbackservice->pushlobaradoqsautomatedkeport, sreportroacast^Sth1s→>L000gPS$1Sthis->eventi} catch (ModeLNCSthis->loggeFirefox= $reportUuid,erron' => sexcention->detMessadeOl.return response() ->json(['status' →> 'error', 'message'=> 'Report not found'], status: 404);catchThrowable Sexcention) ^$this->logger->error(self::LOG_PREFIX ' Failed to update report status', ['vuid' = SreportUvid,'error' => $exception-›getMessage(),return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);return response()->json(['status' => 'ok']);540541549865.575577578v"ketro - Platorm • In 1h 13 m# console [PKob)A console (EU]A console [STAGING] XTx: Auto vA SF [jiminny@localhost]Playgroundf ho_local Uiminny@localnost# crm contiquration1d, crm provider 1d, transcription 1d, status# and crm provider 1d IS NUT NULLand provider = 'uploader' and actual start time Is Not NULLORDER OV 10 desc:select * trom activitles where 1d = 54747785:# 00U040000000207MADselect p.id, p.activity_type, pc.id, pc.nameFROM playbooks pjoin playbook_categories pc 1<->1.n: on p.id = pc.playbook_idwhere p.team id = 1 and p.activity tvoe = 'event'.SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';SELECT * FROM crm_field_values WHERE crm_field_id = 4;select * from crm_layouts cl join playbook_layouts pl 1<->1.n: on cl.id = pl.layout_idwhere crm_configuration_id = 1 and pl.playbook_id = 175;100% 5&• Tue 12 May 15:47:29Sajiminny_mars- | 04 A1 X13 ^select * from automated report results where report id IN (18. 33):select * from activity_searches where id = 10932;where activity search 1d = 109521select * from automated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated nenont results where 1d iiN 810-select * from users where id IN (10633, 13987, 11985);select * from usens whene aroun id TN (37100•SELECT * EROM automated nenonts WHERE uuid to bin(118a06a75-afd2-476f-aadc-14d4057hdda20) = uuidsSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uvid;select * from automated_report_results where media_type = 'pdf' and status = 2;SELECT * FROM automated_report_results WHERE Uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uvid;W Windsurf Toams 115-02 (20 charc) UTF.8f? 4 spaces...
|
NULL
|
2906061397510949400
|
NULL
|
visual_change
|
ocr
|
NULL
|
PhostormFV faVsco.js vProjectINavicarecode%9 JY-20 PhostormFV faVsco.js vProjectINavicarecode%9 JY-20725-handle-HS-search-rate-limPlaybackController.php© MomentController.ph© NudgeController.php® NumberAllocatorCon© OrganizationLicense:© OrganizationMembero ureanizauonkelenule© OrganizationRolesCoc) Organizationsynccol© PartnerController.phy) Phonenumbercontrc© PlaybackController.p©PlaylistController.phg® ScimController.phpSidekickController.pl© SoftphoneController.c) Ssocontroller.oho© SubscriptionControll 109C) TeamAiAutomatione© TeamAiContextContr 111P TeamController.ohpAutomatedkeponkesuitonpclass keportuoncroller excenas Adstractlontroller(C) TranscriotionControll© TranslationController 115© UserController.php© VocabularyControllerm AuthiCustomerApiInternal~ D Kiosk>D Teams©ActivityController.ph|© AutomatedReportsC, 124© DashboardController© ImpersonationContrc 126© MediaPipelineControOrganizationsContro 128© PartnersController.pt© ProfileController.phpc) Searchcontroller.ohr> D Settings> M Telephonv~ D Webhook• M Hubsoot> D IntegrationAppSubsc 136(C) ActivitvProviderCont© ActivityTranscriptionC) BaseController.oho© CalendarController.pC) RenortController nhoSoftphoneWebhookCC. AbstractController nhnif (Sreport->getReport() ->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) €send the primary revort$this->dispatcher->dispatch(new SendReportJob($reportUuid));// send the podcast report if it set and generatedif (SreportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) €$this-›dispatcher-›dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));// Track Datadog metrics for automated reportsSautomatedReport = $report->getReport();scnis->caLLbackservice->pushlovaradoe caucomareakeport, sreporcif (SreportPodcast) {schis->callbackservice->pushlobaradoqsautomatedkeport, sreportroacast^Sth1s→>L000gPS$1Sthis->eventi} catch (ModeLNCSthis->loggeFirefox= $reportUuid,erron' => sexcention->detMessadeOl.return response() ->json(['status' →> 'error', 'message'=> 'Report not found'], status: 404);catchThrowable Sexcention) ^$this->logger->error(self::LOG_PREFIX ' Failed to update report status', ['vuid' = SreportUvid,'error' => $exception-›getMessage(),return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);return response()->json(['status' => 'ok']);540541549865.575577578v"ketro - Platorm • In 1h 13 m# console [PKob)A console (EU]A console [STAGING] XTx: Auto vA SF [jiminny@localhost]Playgroundf ho_local Uiminny@localnost# crm contiquration1d, crm provider 1d, transcription 1d, status# and crm provider 1d IS NUT NULLand provider = 'uploader' and actual start time Is Not NULLORDER OV 10 desc:select * trom activitles where 1d = 54747785:# 00U040000000207MADselect p.id, p.activity_type, pc.id, pc.nameFROM playbooks pjoin playbook_categories pc 1<->1.n: on p.id = pc.playbook_idwhere p.team id = 1 and p.activity tvoe = 'event'.SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';SELECT * FROM crm_field_values WHERE crm_field_id = 4;select * from crm_layouts cl join playbook_layouts pl 1<->1.n: on cl.id = pl.layout_idwhere crm_configuration_id = 1 and pl.playbook_id = 175;100% 5&• Tue 12 May 15:47:29Sajiminny_mars- | 04 A1 X13 ^select * from automated report results where report id IN (18. 33):select * from activity_searches where id = 10932;where activity search 1d = 109521select * from automated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated nenont results where 1d iiN 810-select * from users where id IN (10633, 13987, 11985);select * from usens whene aroun id TN (37100•SELECT * EROM automated nenonts WHERE uuid to bin(118a06a75-afd2-476f-aadc-14d4057hdda20) = uuidsSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uvid;select * from automated_report_results where media_type = 'pdf' and status = 2;SELECT * FROM automated_report_results WHERE Uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uvid;W Windsurf Toams 115-02 (20 charc) UTF.8f? 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26608
|
1102
|
6
|
2026-05-12T12:47:30.296783+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590050296_m1.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
2781094181057815545
|
-2866028224239243100
|
app_switch
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26610
|
1103
|
8
|
2026-05-12T12:47:32.950366+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590052950_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Pipelines - jiminny/app
app.circleci.com
Unnamed G Pipelines - jiminny/app
app.circleci.com
Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
Close tab
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.08361037,"top":0.15363128,"width":0.041223403,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"app.circleci.com","depth":4,"bounds":{"left":0.08361037,"top":0.16440542,"width":0.028590426,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Unnamed Group","depth":4,"bounds":{"left":0.0028257978,"top":0.057063047,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"bounds":{"left":0.0028257978,"top":0.08060654,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"bounds":{"left":0.015957447,"top":0.09217877,"width":0.40492022,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0028257978,"top":0.11332801,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.015957447,"top":0.12490024,"width":0.04138963,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.12051077,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.14604948,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.15762171,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.15323225,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"bounds":{"left":0.0,"top":0.17877094,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.19034317,"width":0.16140293,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.21149242,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.22306465,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"bounds":{"left":0.0,"top":0.2442139,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.25578612,"width":0.1200133,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.27693537,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.28850758,"width":0.1931516,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"bounds":{"left":0.0,"top":0.30965683,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.32122904,"width":0.07646277,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3423783,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.35395053,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"bounds":{"left":0.0,"top":0.37509975,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.386672,"width":0.09524601,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"bounds":{"left":0.0,"top":0.40782124,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.41939345,"width":0.053025264,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"bounds":{"left":0.0,"top":0.4405427,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"bounds":{"left":0.013297873,"top":0.4521149,"width":0.030418882,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.0028257978,"top":0.47486034,"width":0.07413564,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0028257978,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"bounds":{"left":0.013796543,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.024933511,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"bounds":{"left":0.036070477,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"bounds":{"left":0.04720745,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"bounds":{"left":0.07962101,"top":0.055067837,"width":0.021609042,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"bounds":{"left":0.079288565,"top":0.054269753,"width":0.0013297872,"height":0.0015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"bounds":{"left":0.079953454,"top":0.055067837,"width":0.01662234,"height":0.051476456},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"bounds":{"left":0.1015625,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"bounds":{"left":0.11818484,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"bounds":{"left":0.13480718,"top":0.0622506,"width":0.17952128,"height":0.023942538},"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"bounds":{"left":0.30103058,"top":0.06464485,"width":0.009973404,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"bounds":{"left":0.27942154,"top":0.06743815,"width":0.023271276,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"bounds":{"left":0.8128325,"top":0.055067837,"width":0.015957447,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"bounds":{"left":0.8287899,"top":0.058260176,"width":0.01662234,"height":0.031923383},"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"bounds":{"left":0.84541225,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"bounds":{"left":0.86203456,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"bounds":{"left":0.8786569,"top":0.055067837,"width":0.053690158,"height":0.03830806},"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"bounds":{"left":0.8843085,"top":0.06823623,"width":0.03706782,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"bounds":{"left":0.93234706,"top":0.055067837,"width":0.067652926,"height":0.03830806},"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"bounds":{"left":0.9353391,"top":0.057063047,"width":0.05435505,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"bounds":{"left":0.98204786,"top":0.075418994,"width":0.010638298,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"bounds":{"left":0.08228058,"top":0.09577015,"width":0.020279255,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"bounds":{"left":0.09291888,"top":0.1009577,"width":0.006981383,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"bounds":{"left":0.10255984,"top":0.09577015,"width":0.057513297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"bounds":{"left":0.11319814,"top":0.1009577,"width":0.044215426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"bounds":{"left":0.16007313,"top":0.09577015,"width":0.017952127,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"bounds":{"left":0.17071144,"top":0.1009577,"width":0.004654255,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"bounds":{"left":0.17802526,"top":0.09577015,"width":0.03507314,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"bounds":{"left":0.18866356,"top":0.1009577,"width":0.021775266,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"bounds":{"left":0.2130984,"top":0.09577015,"width":0.03523936,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"bounds":{"left":0.2237367,"top":0.1009577,"width":0.021941489,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"bounds":{"left":0.24833776,"top":0.09577015,"width":0.033909574,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"bounds":{"left":0.25897607,"top":0.1009577,"width":0.020611702,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"bounds":{"left":0.28224733,"top":0.09577015,"width":0.041888297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"bounds":{"left":0.29288563,"top":0.1009577,"width":0.028590426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"bounds":{"left":0.32413563,"top":0.09577015,"width":0.0631649,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"bounds":{"left":0.33477393,"top":0.1009577,"width":0.051861703,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"bounds":{"left":0.38730052,"top":0.09577015,"width":0.033410903,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"bounds":{"left":0.39793882,"top":0.1009577,"width":0.020113032,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"bounds":{"left":0.42071143,"top":0.09577015,"width":0.031416222,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"bounds":{"left":0.43134972,"top":0.1009577,"width":0.018118352,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"bounds":{"left":0.08494016,"top":0.12410215,"width":0.009973404,"height":0.023942538},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"bounds":{"left":0.098902926,"top":0.1272945,"width":0.026928192,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"bounds":{"left":0.099567816,"top":0.1292897,"width":0.025598405,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"bounds":{"left":0.13646941,"top":0.12809257,"width":0.028590426,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"bounds":{"left":0.13646941,"top":0.1292897,"width":0.028590426,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Query definition","depth":26,"bounds":{"left":0.09424867,"top":0.16959298,"width":0.05036569,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXButton","text":"Query definition","depth":28,"bounds":{"left":0.085605055,"top":0.16959298,"width":0.05900931,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Info : Query definition","depth":27,"bounds":{"left":0.14727394,"top":0.17557861,"width":0.0076462766,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log Analytics","depth":29,"bounds":{"left":0.17253989,"top":0.17517957,"width":0.02443484,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"a unified observability platform for a smoother experience, now in preview mode. Click","depth":28,"bounds":{"left":0.19963431,"top":0.1735834,"width":0.1853391,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"here","depth":28,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"here","depth":29,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"to try it out!","depth":28,"bounds":{"left":0.39444813,"top":0.1735834,"width":0.026595745,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"5m (5 Minutes)","depth":27,"bounds":{"left":0.7155917,"top":0.1707901,"width":0.012134309,"height":0.015961692},"on_screen":true,"help_text":"5 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"30m (30 Minutes)","depth":27,"bounds":{"left":0.73537236,"top":0.1707901,"width":0.014960106,"height":0.015961692},"on_screen":true,"help_text":"30 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"1h (1 Hour)","depth":27,"bounds":{"left":0.75797874,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"1 Hour","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"3h (3 Hours)","depth":27,"bounds":{"left":0.77642953,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"3 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"12h (12 Hours)","depth":27,"bounds":{"left":0.7947141,"top":0.1707901,"width":0.013630319,"height":0.015961692},"on_screen":true,"help_text":"12 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Custom","depth":27,"bounds":{"left":0.8159907,"top":0.1707901,"width":0.024268618,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Custom","depth":29,"bounds":{"left":0.8159907,"top":0.17158818,"width":0.016289894,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"Compare (Off)","depth":26,"bounds":{"left":0.84674203,"top":0.16679968,"width":0.046875,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Compare","depth":27,"bounds":{"left":0.8540558,"top":0.17238627,"width":0.019946808,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.87400264,"top":0.17238627,"width":0.0028257978,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Off","depth":27,"bounds":{"left":0.87682843,"top":0.17238627,"width":0.0078125,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.88464093,"top":0.17238627,"width":0.0016622341,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Time zone UTC timezone","depth":26,"bounds":{"left":0.8959442,"top":0.16679968,"width":0.046043884,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"UTC timezone","depth":28,"bounds":{"left":0.90026593,"top":0.17238627,"width":0.029421542,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Start tailing with selected log group (opens in a new tab)","depth":26,"bounds":{"left":0.9459774,"top":0.16679968,"width":0.048038565,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Start tailing","depth":27,"bounds":{"left":0.95994014,"top":0.17238627,"width":0.026761968,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query scope","depth":28,"bounds":{"left":0.085605055,"top":0.21827614,"width":0.027094414,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Query scope All log groups","depth":27,"bounds":{"left":0.085605055,"top":0.24102154,"width":0.06648936,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"All log groups","depth":29,"bounds":{"left":0.08992686,"top":0.24700718,"width":0.02925532,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"All log groups","depth":26,"bounds":{"left":0.15807846,"top":0.24102154,"width":0.73055184,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"search text field","subrole":"AXSearchField","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log class","depth":28,"bounds":{"left":0.8912899,"top":0.21827614,"width":0.019780586,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Log class STANDARD","depth":27,"bounds":{"left":0.8912899,"top":0.24102154,"width":0.04305186,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"STANDARD","depth":29,"bounds":{"left":0.8956117,"top":0.24700718,"width":0.023603724,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Account(s)","depth":28,"bounds":{"left":0.93700135,"top":0.21827614,"width":0.022938829,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Account(s) Change Account(s)","depth":27,"bounds":{"left":0.93700135,"top":0.24102154,"width":0.05319149,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Change Account(s)","depth":29,"bounds":{"left":0.94132316,"top":0.24700718,"width":0.038065158,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Remove All accounts","depth":29,"bounds":{"left":0.96825135,"top":0.27773345,"width":0.008643617,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Undo","depth":28,"bounds":{"left":0.94431514,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Redo","depth":28,"bounds":{"left":0.9562833,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXMenuButton","text":"Logs Insights QL","depth":29,"bounds":{"left":0.09125665,"top":0.4696728,"width":0.057679523,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Query generator","depth":26,"bounds":{"left":0.15159574,"top":0.4660814,"width":0.05236037,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Query generator","depth":28,"bounds":{"left":0.16356383,"top":0.4744613,"width":0.036402926,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Fields","depth":28,"bounds":{"left":0.21459441,"top":0.4744613,"width":0.012799202,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Saved and sample queries","depth":28,"bounds":{"left":0.24202128,"top":0.4744613,"width":0.05651596,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query commands","depth":28,"bounds":{"left":0.3131649,"top":0.4744613,"width":0.03856383,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Run query","depth":27,"bounds":{"left":0.085605055,"top":0.509178,"width":0.03723404,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Cancel","depth":27,"bounds":{"left":0.12549867,"top":0.509178,"width":0.02925532,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Save","depth":27,"bounds":{"left":0.15741356,"top":0.509178,"width":0.024933511,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"History","depth":27,"bounds":{"left":0.24634309,"top":0.509178,"width":0.030751329,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Completed. Query executed for","depth":28,"bounds":{"left":0.09225399,"top":0.5422985,"width":0.06615692,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"78 log groups.","depth":28,"bounds":{"left":0.15957446,"top":0.5422985,"width":0.03025266,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"View log groups used in query","depth":28,"bounds":{"left":0.19099069,"top":0.5422985,"width":0.005319149,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Logs (5)","depth":25,"bounds":{"left":0.081615694,"top":0.57781327,"width":0.028091755,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"Logs","depth":27,"bounds":{"left":0.085605055,"top":0.58739024,"width":0.011469414,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.09857048,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"5","depth":27,"bounds":{"left":0.100398935,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.103557184,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Patterns (1)","depth":25,"bounds":{"left":0.115359046,"top":0.57781327,"width":0.03756649,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Patterns","depth":27,"bounds":{"left":0.11934841,"top":0.58739024,"width":0.021110373,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.14045878,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"1","depth":27,"bounds":{"left":0.14361702,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.14677526,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Visualization","depth":25,"bounds":{"left":0.15857713,"top":0.57781327,"width":0.04089096,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Visualization","depth":27,"bounds":{"left":0.16256648,"top":0.58739024,"width":0.032579787,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Logs (5)","depth":26,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Logs (5)","depth":27,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Summarize results","depth":26,"bounds":{"left":0.6627327,"top":0.61851555,"width":0.06216755,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Summarize results","depth":27,"bounds":{"left":0.67669547,"top":0.62450117,"width":0.04089096,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Investigate","depth":28,"bounds":{"left":0.72755986,"top":0.61851555,"width":0.05285904,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Investigate","depth":29,"bounds":{"left":0.7421875,"top":0.62450117,"width":0.024268618,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Share results","depth":26,"bounds":{"left":0.78307843,"top":0.61851555,"width":0.050033245,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Share results","depth":27,"bounds":{"left":0.79704124,"top":0.62450117,"width":0.028756648,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Export results","depth":28,"bounds":{"left":0.83577126,"top":0.61851555,"width":0.052027926,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Export results","depth":29,"bounds":{"left":0.8430851,"top":0.62450117,"width":0.030751329,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Add to dashboard","depth":26,"bounds":{"left":0.89045876,"top":0.61851555,"width":0.054022606,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Showing 5 of 5 records matched","depth":29,"bounds":{"left":0.4865359,"top":0.6584198,"width":0.075465426,"height":0.016759777},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)","depth":29,"bounds":{"left":0.4381649,"top":0.6763767,"width":0.17204122,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Hide histogram","depth":26,"bounds":{"left":0.9665891,"top":0.65682364,"width":0.031083776,"height":0.03431764},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Hide histogram","depth":27,"bounds":{"left":0.9665891,"top":0.65881884,"width":0.027759308,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"Filter table results","depth":25,"bounds":{"left":0.08261303,"top":0.7765363,"width":0.21542554,"height":0.025538707},"on_screen":true,"help_text":"","placeholder":"Filter table results (case insensitive)...","role_description":"search text field","subrole":"AXSearchField","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Completed. Query executed for 78 log groups.","depth":19,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudShell","depth":12,"bounds":{"left":0.08494016,"top":0.9784517,"width":0.02642952,"height":0.015961692},"on_screen":true,"help_text":"Open CloudShell","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudShell","depth":14,"bounds":{"left":0.091921546,"top":0.98044693,"width":0.019448139,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Feedback","depth":11,"bounds":{"left":0.11968085,"top":0.980846,"width":0.017121011,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Feedback","depth":13,"bounds":{"left":0.11968085,"top":0.98044693,"width":0.017121011,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"©","depth":12,"bounds":{"left":0.8159907,"top":0.98044693,"width":0.004155585,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026","depth":12,"bounds":{"left":0.82014626,"top":0.98044693,"width":0.00930851,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":",","depth":12,"bounds":{"left":0.8294548,"top":0.98044693,"width":0.0019946808,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Amazon Web Services, Inc.","depth":12,"bounds":{"left":0.83144945,"top":0.98044693,"width":0.048038565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"or its affiliates.","depth":12,"bounds":{"left":0.88048536,"top":0.98044693,"width":0.026595745,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Privacy","depth":13,"bounds":{"left":0.91705453,"top":0.9796488,"width":0.014295213,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Privacy","depth":14,"bounds":{"left":0.9177194,"top":0.98044693,"width":0.012965426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Terms","depth":13,"bounds":{"left":0.9396609,"top":0.9796488,"width":0.012300532,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Terms","depth":14,"bounds":{"left":0.9403258,"top":0.98044693,"width":0.010970744,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Cookie preferences","depth":13,"bounds":{"left":0.9602726,"top":0.980846,"width":0.034408245,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
1134246211540086301
|
-271972057407213132
|
visual_change
|
accessibility
|
NULL
|
Pipelines - jiminny/app
app.circleci.com
Unnamed G Pipelines - jiminny/app
app.circleci.com
Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
Close tab
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26611
|
1103
|
9
|
2026-05-12T12:47:35.981460+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590055981_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"bounds":{"left":0.0028257978,"top":0.057063047,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"bounds":{"left":0.0028257978,"top":0.08060654,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"bounds":{"left":0.015957447,"top":0.09217877,"width":0.40492022,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0028257978,"top":0.11332801,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.015957447,"top":0.12490024,"width":0.04138963,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.12051077,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.14604948,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.15762171,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"bounds":{"left":0.0,"top":0.17877094,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.19034317,"width":0.16140293,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.21149242,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.22306465,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"bounds":{"left":0.0,"top":0.2442139,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.25578612,"width":0.1200133,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.27693537,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.28850758,"width":0.1931516,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"bounds":{"left":0.0,"top":0.30965683,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.32122904,"width":0.07646277,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3423783,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.35395053,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"bounds":{"left":0.0,"top":0.37509975,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.386672,"width":0.09524601,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"bounds":{"left":0.0,"top":0.40782124,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.41939345,"width":0.053025264,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"bounds":{"left":0.0,"top":0.4405427,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"bounds":{"left":0.013297873,"top":0.4521149,"width":0.030418882,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.0028257978,"top":0.47486034,"width":0.07413564,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0028257978,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"bounds":{"left":0.013796543,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.024933511,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"bounds":{"left":0.036070477,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"bounds":{"left":0.04720745,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"bounds":{"left":0.07962101,"top":0.055067837,"width":0.021609042,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"bounds":{"left":0.079288565,"top":0.054269753,"width":0.0013297872,"height":0.0015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"bounds":{"left":0.079953454,"top":0.055067837,"width":0.01662234,"height":0.051476456},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"bounds":{"left":0.1015625,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"bounds":{"left":0.11818484,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"bounds":{"left":0.13480718,"top":0.0622506,"width":0.17952128,"height":0.023942538},"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"bounds":{"left":0.30103058,"top":0.06464485,"width":0.009973404,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"bounds":{"left":0.27942154,"top":0.06743815,"width":0.023271276,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"bounds":{"left":0.8128325,"top":0.055067837,"width":0.015957447,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"bounds":{"left":0.8287899,"top":0.058260176,"width":0.01662234,"height":0.031923383},"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"bounds":{"left":0.84541225,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"bounds":{"left":0.86203456,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"bounds":{"left":0.8786569,"top":0.055067837,"width":0.053690158,"height":0.03830806},"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"bounds":{"left":0.8843085,"top":0.06823623,"width":0.03706782,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"bounds":{"left":0.93234706,"top":0.055067837,"width":0.067652926,"height":0.03830806},"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"bounds":{"left":0.9353391,"top":0.057063047,"width":0.05435505,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"bounds":{"left":0.98204786,"top":0.075418994,"width":0.010638298,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"bounds":{"left":0.08228058,"top":0.09577015,"width":0.020279255,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"bounds":{"left":0.09291888,"top":0.1009577,"width":0.006981383,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"bounds":{"left":0.10255984,"top":0.09577015,"width":0.057513297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"bounds":{"left":0.11319814,"top":0.1009577,"width":0.044215426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"bounds":{"left":0.16007313,"top":0.09577015,"width":0.017952127,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"bounds":{"left":0.17071144,"top":0.1009577,"width":0.004654255,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"bounds":{"left":0.17802526,"top":0.09577015,"width":0.03507314,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"bounds":{"left":0.18866356,"top":0.1009577,"width":0.021775266,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"bounds":{"left":0.2130984,"top":0.09577015,"width":0.03523936,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"bounds":{"left":0.2237367,"top":0.1009577,"width":0.021941489,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"bounds":{"left":0.24833776,"top":0.09577015,"width":0.033909574,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"bounds":{"left":0.25897607,"top":0.1009577,"width":0.020611702,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"bounds":{"left":0.28224733,"top":0.09577015,"width":0.041888297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"bounds":{"left":0.29288563,"top":0.1009577,"width":0.028590426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"bounds":{"left":0.32413563,"top":0.09577015,"width":0.0631649,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"bounds":{"left":0.33477393,"top":0.1009577,"width":0.051861703,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"bounds":{"left":0.38730052,"top":0.09577015,"width":0.033410903,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"bounds":{"left":0.39793882,"top":0.1009577,"width":0.020113032,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"bounds":{"left":0.42071143,"top":0.09577015,"width":0.031416222,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"bounds":{"left":0.43134972,"top":0.1009577,"width":0.018118352,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"bounds":{"left":0.08494016,"top":0.12410215,"width":0.009973404,"height":0.023942538},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"bounds":{"left":0.098902926,"top":0.1272945,"width":0.026928192,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"bounds":{"left":0.099567816,"top":0.1292897,"width":0.025598405,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"bounds":{"left":0.13646941,"top":0.12809257,"width":0.028590426,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"bounds":{"left":0.13646941,"top":0.1292897,"width":0.028590426,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Query definition","depth":26,"bounds":{"left":0.09424867,"top":0.16959298,"width":0.05036569,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXButton","text":"Query definition","depth":28,"bounds":{"left":0.085605055,"top":0.16959298,"width":0.05900931,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Info : Query definition","depth":27,"bounds":{"left":0.14727394,"top":0.17557861,"width":0.0076462766,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log Analytics","depth":29,"bounds":{"left":0.17253989,"top":0.17517957,"width":0.02443484,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"a unified observability platform for a smoother experience, now in preview mode. Click","depth":28,"bounds":{"left":0.19963431,"top":0.1735834,"width":0.1853391,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"here","depth":28,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"here","depth":29,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"to try it out!","depth":28,"bounds":{"left":0.39444813,"top":0.1735834,"width":0.026595745,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"5m (5 Minutes)","depth":27,"bounds":{"left":0.7155917,"top":0.1707901,"width":0.012134309,"height":0.015961692},"on_screen":true,"help_text":"5 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"30m (30 Minutes)","depth":27,"bounds":{"left":0.73537236,"top":0.1707901,"width":0.014960106,"height":0.015961692},"on_screen":true,"help_text":"30 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"1h (1 Hour)","depth":27,"bounds":{"left":0.75797874,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"1 Hour","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"3h (3 Hours)","depth":27,"bounds":{"left":0.77642953,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"3 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"12h (12 Hours)","depth":27,"bounds":{"left":0.7947141,"top":0.1707901,"width":0.013630319,"height":0.015961692},"on_screen":true,"help_text":"12 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Custom","depth":27,"bounds":{"left":0.8159907,"top":0.1707901,"width":0.024268618,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Custom","depth":29,"bounds":{"left":0.8159907,"top":0.17158818,"width":0.016289894,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"Compare (Off)","depth":26,"bounds":{"left":0.84674203,"top":0.16679968,"width":0.046875,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Compare","depth":27,"bounds":{"left":0.8540558,"top":0.17238627,"width":0.019946808,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.87400264,"top":0.17238627,"width":0.0028257978,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Off","depth":27,"bounds":{"left":0.87682843,"top":0.17238627,"width":0.0078125,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.88464093,"top":0.17238627,"width":0.0016622341,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Time zone UTC timezone","depth":26,"bounds":{"left":0.8959442,"top":0.16679968,"width":0.046043884,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"UTC timezone","depth":28,"bounds":{"left":0.90026593,"top":0.17238627,"width":0.029421542,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Start tailing with selected log group (opens in a new tab)","depth":26,"bounds":{"left":0.9459774,"top":0.16679968,"width":0.048038565,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Start tailing","depth":27,"bounds":{"left":0.95994014,"top":0.17238627,"width":0.026761968,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query scope","depth":28,"bounds":{"left":0.085605055,"top":0.21827614,"width":0.027094414,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Query scope All log groups","depth":27,"bounds":{"left":0.085605055,"top":0.24102154,"width":0.06648936,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"All log groups","depth":29,"bounds":{"left":0.08992686,"top":0.24700718,"width":0.02925532,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"All log groups","depth":26,"bounds":{"left":0.15807846,"top":0.24102154,"width":0.73055184,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"search text field","subrole":"AXSearchField","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log class","depth":28,"bounds":{"left":0.8912899,"top":0.21827614,"width":0.019780586,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Log class STANDARD","depth":27,"bounds":{"left":0.8912899,"top":0.24102154,"width":0.04305186,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"STANDARD","depth":29,"bounds":{"left":0.8956117,"top":0.24700718,"width":0.023603724,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Account(s)","depth":28,"bounds":{"left":0.93700135,"top":0.21827614,"width":0.022938829,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Account(s) Change Account(s)","depth":27,"bounds":{"left":0.93700135,"top":0.24102154,"width":0.05319149,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Change Account(s)","depth":29,"bounds":{"left":0.94132316,"top":0.24700718,"width":0.038065158,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Remove All accounts","depth":29,"bounds":{"left":0.96825135,"top":0.27773345,"width":0.008643617,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Undo","depth":28,"bounds":{"left":0.94431514,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Redo","depth":28,"bounds":{"left":0.9562833,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXMenuButton","text":"Logs Insights QL","depth":29,"bounds":{"left":0.09125665,"top":0.4696728,"width":0.057679523,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Query generator","depth":26,"bounds":{"left":0.15159574,"top":0.4660814,"width":0.05236037,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Query generator","depth":28,"bounds":{"left":0.16356383,"top":0.4744613,"width":0.036402926,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Fields","depth":28,"bounds":{"left":0.21459441,"top":0.4744613,"width":0.012799202,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Saved and sample queries","depth":28,"bounds":{"left":0.24202128,"top":0.4744613,"width":0.05651596,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query commands","depth":28,"bounds":{"left":0.3131649,"top":0.4744613,"width":0.03856383,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Run query","depth":27,"bounds":{"left":0.085605055,"top":0.509178,"width":0.03723404,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Cancel","depth":27,"bounds":{"left":0.12549867,"top":0.509178,"width":0.02925532,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Save","depth":27,"bounds":{"left":0.15741356,"top":0.509178,"width":0.024933511,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"History","depth":27,"bounds":{"left":0.24634309,"top":0.509178,"width":0.030751329,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Completed. Query executed for","depth":28,"bounds":{"left":0.09225399,"top":0.5422985,"width":0.06615692,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"78 log groups.","depth":28,"bounds":{"left":0.15957446,"top":0.5422985,"width":0.03025266,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"View log groups used in query","depth":28,"bounds":{"left":0.19099069,"top":0.5422985,"width":0.005319149,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Logs (5)","depth":25,"bounds":{"left":0.081615694,"top":0.57781327,"width":0.028091755,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"Logs","depth":27,"bounds":{"left":0.085605055,"top":0.58739024,"width":0.011469414,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.09857048,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"5","depth":27,"bounds":{"left":0.100398935,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.103557184,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Patterns (1)","depth":25,"bounds":{"left":0.115359046,"top":0.57781327,"width":0.03756649,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Patterns","depth":27,"bounds":{"left":0.11934841,"top":0.58739024,"width":0.021110373,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.14045878,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"1","depth":27,"bounds":{"left":0.14361702,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.14677526,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Visualization","depth":25,"bounds":{"left":0.15857713,"top":0.57781327,"width":0.04089096,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Visualization","depth":27,"bounds":{"left":0.16256648,"top":0.58739024,"width":0.032579787,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Logs (5)","depth":26,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Logs (5)","depth":27,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Summarize results","depth":26,"bounds":{"left":0.6627327,"top":0.61851555,"width":0.06216755,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Summarize results","depth":27,"bounds":{"left":0.67669547,"top":0.62450117,"width":0.04089096,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Investigate","depth":28,"bounds":{"left":0.72755986,"top":0.61851555,"width":0.05285904,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Investigate","depth":29,"bounds":{"left":0.7421875,"top":0.62450117,"width":0.024268618,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Share results","depth":26,"bounds":{"left":0.78307843,"top":0.61851555,"width":0.050033245,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Share results","depth":27,"bounds":{"left":0.79704124,"top":0.62450117,"width":0.028756648,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Export results","depth":28,"bounds":{"left":0.83577126,"top":0.61851555,"width":0.052027926,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Export results","depth":29,"bounds":{"left":0.8430851,"top":0.62450117,"width":0.030751329,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Add to dashboard","depth":26,"bounds":{"left":0.89045876,"top":0.61851555,"width":0.054022606,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Showing 5 of 5 records matched","depth":29,"bounds":{"left":0.4865359,"top":0.6584198,"width":0.075465426,"height":0.016759777},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)","depth":29,"bounds":{"left":0.4381649,"top":0.6763767,"width":0.17204122,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Hide histogram","depth":26,"bounds":{"left":0.9665891,"top":0.65682364,"width":0.031083776,"height":0.03431764},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Hide histogram","depth":27,"bounds":{"left":0.9665891,"top":0.65881884,"width":0.027759308,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"Filter table results","depth":25,"bounds":{"left":0.08261303,"top":0.7765363,"width":0.21542554,"height":0.025538707},"on_screen":true,"help_text":"","placeholder":"Filter table results (case insensitive)...","role_description":"search text field","subrole":"AXSearchField","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
3179442318117426516
|
-272112794895568460
|
visual_change
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app...
|
26610
|
NULL
|
NULL
|
NULL
|
|
26612
|
1102
|
7
|
2026-05-12T12:48:00.492366+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590080492_m1.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Query definition","depth":26,"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXButton","text":"Query definition","depth":28,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Info : Query definition","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log Analytics","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"a unified observability platform for a smoother experience, now in preview mode. Click","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"here","depth":28,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"here","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"to try it out!","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"5m (5 Minutes)","depth":27,"on_screen":true,"help_text":"5 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"30m (30 Minutes)","depth":27,"on_screen":true,"help_text":"30 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"1h (1 Hour)","depth":27,"on_screen":true,"help_text":"1 Hour","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"3h (3 Hours)","depth":27,"on_screen":true,"help_text":"3 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"12h (12 Hours)","depth":27,"on_screen":true,"help_text":"12 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Custom","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Custom","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"Compare (Off)","depth":26,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Compare","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Off","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Time zone UTC timezone","depth":26,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"UTC timezone","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Start tailing with selected log group (opens in a new tab)","depth":26,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Start tailing","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query scope","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Query scope All log groups","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"All log groups","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"All log groups","depth":26,"on_screen":true,"help_text":"","role_description":"search text field","subrole":"AXSearchField","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log class","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Log class STANDARD","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"STANDARD","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Account(s)","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Account(s) Change Account(s)","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Change Account(s)","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Remove All accounts","depth":29,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Undo","depth":28,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Redo","depth":28,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXMenuButton","text":"Logs Insights QL","depth":29,"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Query generator","depth":26,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Query generator","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Fields","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Saved and sample queries","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query commands","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Run query","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Cancel","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Save","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"History","depth":27,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Completed. Query executed for","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"78 log groups.","depth":28,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"View log groups used in query","depth":28,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Logs (5)","depth":25,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"Logs","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"5","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Patterns (1)","depth":25,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Patterns","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"1","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Visualization","depth":25,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Visualization","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Logs (5)","depth":26,"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Logs (5)","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Summarize results","depth":26,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Summarize results","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Investigate","depth":28,"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Investigate","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Share results","depth":26,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Share results","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Export results","depth":28,"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Export results","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Add to dashboard","depth":26,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Showing 5 of 5 records matched","depth":29,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Hide histogram","depth":26,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Hide histogram","depth":27,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"Filter table results","depth":25,"on_screen":true,"help_text":"","placeholder":"Filter table results (case insensitive)...","role_description":"search text field","subrole":"AXSearchField","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.51319444,"top":0.0,"width":0.23402777,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.7736111,"top":0.0,"width":0.1,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
3889523177741746108
|
-127997606811291468
|
idle
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}...
|
26608
|
NULL
|
NULL
|
NULL
|
|
26613
|
1103
|
10
|
2026-05-12T12:48:06.302188+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590086302_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"bounds":{"left":0.0028257978,"top":0.057063047,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"bounds":{"left":0.0028257978,"top":0.08060654,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"bounds":{"left":0.015957447,"top":0.09217877,"width":0.40492022,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0028257978,"top":0.11332801,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.015957447,"top":0.12490024,"width":0.04138963,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.12051077,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.14604948,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.15762171,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"bounds":{"left":0.0,"top":0.17877094,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.19034317,"width":0.16140293,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.21149242,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.22306465,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"bounds":{"left":0.0,"top":0.2442139,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.25578612,"width":0.1200133,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.27693537,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.28850758,"width":0.1931516,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"bounds":{"left":0.0,"top":0.30965683,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.32122904,"width":0.07646277,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3423783,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.35395053,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"bounds":{"left":0.0,"top":0.37509975,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.386672,"width":0.09524601,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"bounds":{"left":0.0,"top":0.40782124,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.41939345,"width":0.053025264,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"bounds":{"left":0.0,"top":0.4405427,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"bounds":{"left":0.013297873,"top":0.4521149,"width":0.030418882,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.0028257978,"top":0.47486034,"width":0.07413564,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0028257978,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"bounds":{"left":0.013796543,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.024933511,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"bounds":{"left":0.036070477,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"bounds":{"left":0.04720745,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"bounds":{"left":0.07962101,"top":0.055067837,"width":0.021609042,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"bounds":{"left":0.079288565,"top":0.054269753,"width":0.0013297872,"height":0.0015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"bounds":{"left":0.079953454,"top":0.055067837,"width":0.01662234,"height":0.051476456},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"bounds":{"left":0.1015625,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"bounds":{"left":0.11818484,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"bounds":{"left":0.13480718,"top":0.0622506,"width":0.17952128,"height":0.023942538},"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"bounds":{"left":0.30103058,"top":0.06464485,"width":0.009973404,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"bounds":{"left":0.27942154,"top":0.06743815,"width":0.023271276,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"bounds":{"left":0.8128325,"top":0.055067837,"width":0.015957447,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"bounds":{"left":0.8287899,"top":0.058260176,"width":0.01662234,"height":0.031923383},"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"bounds":{"left":0.84541225,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"bounds":{"left":0.86203456,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"bounds":{"left":0.8786569,"top":0.055067837,"width":0.053690158,"height":0.03830806},"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"bounds":{"left":0.8843085,"top":0.06823623,"width":0.03706782,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"bounds":{"left":0.93234706,"top":0.055067837,"width":0.067652926,"height":0.03830806},"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"bounds":{"left":0.9353391,"top":0.057063047,"width":0.05435505,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"bounds":{"left":0.98204786,"top":0.075418994,"width":0.010638298,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"bounds":{"left":0.08228058,"top":0.09577015,"width":0.020279255,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"bounds":{"left":0.09291888,"top":0.1009577,"width":0.006981383,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"bounds":{"left":0.10255984,"top":0.09577015,"width":0.057513297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"bounds":{"left":0.11319814,"top":0.1009577,"width":0.044215426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"bounds":{"left":0.16007313,"top":0.09577015,"width":0.017952127,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"bounds":{"left":0.17071144,"top":0.1009577,"width":0.004654255,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"bounds":{"left":0.17802526,"top":0.09577015,"width":0.03507314,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"bounds":{"left":0.18866356,"top":0.1009577,"width":0.021775266,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"bounds":{"left":0.2130984,"top":0.09577015,"width":0.03523936,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"bounds":{"left":0.2237367,"top":0.1009577,"width":0.021941489,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"bounds":{"left":0.24833776,"top":0.09577015,"width":0.033909574,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"bounds":{"left":0.25897607,"top":0.1009577,"width":0.020611702,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"bounds":{"left":0.28224733,"top":0.09577015,"width":0.041888297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"bounds":{"left":0.29288563,"top":0.1009577,"width":0.028590426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"bounds":{"left":0.32413563,"top":0.09577015,"width":0.0631649,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"bounds":{"left":0.33477393,"top":0.1009577,"width":0.051861703,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"bounds":{"left":0.38730052,"top":0.09577015,"width":0.033410903,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"bounds":{"left":0.39793882,"top":0.1009577,"width":0.020113032,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"bounds":{"left":0.42071143,"top":0.09577015,"width":0.031416222,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"bounds":{"left":0.43134972,"top":0.1009577,"width":0.018118352,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"bounds":{"left":0.08494016,"top":0.12410215,"width":0.009973404,"height":0.023942538},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"bounds":{"left":0.098902926,"top":0.1272945,"width":0.026928192,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"bounds":{"left":0.099567816,"top":0.1292897,"width":0.025598405,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"bounds":{"left":0.13646941,"top":0.12809257,"width":0.028590426,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"bounds":{"left":0.13646941,"top":0.1292897,"width":0.028590426,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Query definition","depth":26,"bounds":{"left":0.09424867,"top":0.16959298,"width":0.05036569,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXButton","text":"Query definition","depth":28,"bounds":{"left":0.085605055,"top":0.16959298,"width":0.05900931,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Info : Query definition","depth":27,"bounds":{"left":0.14727394,"top":0.17557861,"width":0.0076462766,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log Analytics","depth":29,"bounds":{"left":0.17253989,"top":0.17517957,"width":0.02443484,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"a unified observability platform for a smoother experience, now in preview mode. Click","depth":28,"bounds":{"left":0.19963431,"top":0.1735834,"width":0.1853391,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"here","depth":28,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"here","depth":29,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"to try it out!","depth":28,"bounds":{"left":0.39444813,"top":0.1735834,"width":0.026595745,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"5m (5 Minutes)","depth":27,"bounds":{"left":0.7155917,"top":0.1707901,"width":0.012134309,"height":0.015961692},"on_screen":true,"help_text":"5 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"30m (30 Minutes)","depth":27,"bounds":{"left":0.73537236,"top":0.1707901,"width":0.014960106,"height":0.015961692},"on_screen":true,"help_text":"30 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"1h (1 Hour)","depth":27,"bounds":{"left":0.75797874,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"1 Hour","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"3h (3 Hours)","depth":27,"bounds":{"left":0.77642953,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"3 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"12h (12 Hours)","depth":27,"bounds":{"left":0.7947141,"top":0.1707901,"width":0.013630319,"height":0.015961692},"on_screen":true,"help_text":"12 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Custom","depth":27,"bounds":{"left":0.8159907,"top":0.1707901,"width":0.024268618,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Custom","depth":29,"bounds":{"left":0.8159907,"top":0.17158818,"width":0.016289894,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"Compare (Off)","depth":26,"bounds":{"left":0.84674203,"top":0.16679968,"width":0.046875,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Compare","depth":27,"bounds":{"left":0.8540558,"top":0.17238627,"width":0.019946808,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.87400264,"top":0.17238627,"width":0.0028257978,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Off","depth":27,"bounds":{"left":0.87682843,"top":0.17238627,"width":0.0078125,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.88464093,"top":0.17238627,"width":0.0016622341,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Time zone UTC timezone","depth":26,"bounds":{"left":0.8959442,"top":0.16679968,"width":0.046043884,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"UTC timezone","depth":28,"bounds":{"left":0.90026593,"top":0.17238627,"width":0.029421542,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Start tailing with selected log group (opens in a new tab)","depth":26,"bounds":{"left":0.9459774,"top":0.16679968,"width":0.048038565,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Start tailing","depth":27,"bounds":{"left":0.95994014,"top":0.17238627,"width":0.026761968,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query scope","depth":28,"bounds":{"left":0.085605055,"top":0.21827614,"width":0.027094414,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Query scope All log groups","depth":27,"bounds":{"left":0.085605055,"top":0.24102154,"width":0.06648936,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"All log groups","depth":29,"bounds":{"left":0.08992686,"top":0.24700718,"width":0.02925532,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"All log groups","depth":26,"bounds":{"left":0.15807846,"top":0.24102154,"width":0.73055184,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"search text field","subrole":"AXSearchField","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log class","depth":28,"bounds":{"left":0.8912899,"top":0.21827614,"width":0.019780586,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Log class STANDARD","depth":27,"bounds":{"left":0.8912899,"top":0.24102154,"width":0.04305186,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"STANDARD","depth":29,"bounds":{"left":0.8956117,"top":0.24700718,"width":0.023603724,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Account(s)","depth":28,"bounds":{"left":0.93700135,"top":0.21827614,"width":0.022938829,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Account(s) Change Account(s)","depth":27,"bounds":{"left":0.93700135,"top":0.24102154,"width":0.05319149,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Change Account(s)","depth":29,"bounds":{"left":0.94132316,"top":0.24700718,"width":0.038065158,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Remove All accounts","depth":29,"bounds":{"left":0.96825135,"top":0.27773345,"width":0.008643617,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Undo","depth":28,"bounds":{"left":0.94431514,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Redo","depth":28,"bounds":{"left":0.9562833,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXMenuButton","text":"Logs Insights QL","depth":29,"bounds":{"left":0.09125665,"top":0.4696728,"width":0.057679523,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Query generator","depth":26,"bounds":{"left":0.15159574,"top":0.4660814,"width":0.05236037,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Query generator","depth":28,"bounds":{"left":0.16356383,"top":0.4744613,"width":0.036402926,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Fields","depth":28,"bounds":{"left":0.21459441,"top":0.4744613,"width":0.012799202,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Saved and sample queries","depth":28,"bounds":{"left":0.24202128,"top":0.4744613,"width":0.05651596,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query commands","depth":28,"bounds":{"left":0.3131649,"top":0.4744613,"width":0.03856383,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Run query","depth":27,"bounds":{"left":0.085605055,"top":0.509178,"width":0.03723404,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Cancel","depth":27,"bounds":{"left":0.12549867,"top":0.509178,"width":0.02925532,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Save","depth":27,"bounds":{"left":0.15741356,"top":0.509178,"width":0.024933511,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"History","depth":27,"bounds":{"left":0.24634309,"top":0.509178,"width":0.030751329,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Completed. Query executed for","depth":28,"bounds":{"left":0.09225399,"top":0.5422985,"width":0.06615692,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"78 log groups.","depth":28,"bounds":{"left":0.15957446,"top":0.5422985,"width":0.03025266,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"View log groups used in query","depth":28,"bounds":{"left":0.19099069,"top":0.5422985,"width":0.005319149,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Logs (5)","depth":25,"bounds":{"left":0.081615694,"top":0.57781327,"width":0.028091755,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"Logs","depth":27,"bounds":{"left":0.085605055,"top":0.58739024,"width":0.011469414,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.09857048,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"5","depth":27,"bounds":{"left":0.100398935,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.103557184,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Patterns (1)","depth":25,"bounds":{"left":0.115359046,"top":0.57781327,"width":0.03756649,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Patterns","depth":27,"bounds":{"left":0.11934841,"top":0.58739024,"width":0.021110373,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.14045878,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"1","depth":27,"bounds":{"left":0.14361702,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.14677526,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Visualization","depth":25,"bounds":{"left":0.15857713,"top":0.57781327,"width":0.04089096,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Visualization","depth":27,"bounds":{"left":0.16256648,"top":0.58739024,"width":0.032579787,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Logs (5)","depth":26,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Logs (5)","depth":27,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Summarize results","depth":26,"bounds":{"left":0.6627327,"top":0.61851555,"width":0.06216755,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Summarize results","depth":27,"bounds":{"left":0.67669547,"top":0.62450117,"width":0.04089096,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Investigate","depth":28,"bounds":{"left":0.72755986,"top":0.61851555,"width":0.05285904,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Investigate","depth":29,"bounds":{"left":0.7421875,"top":0.62450117,"width":0.024268618,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Share results","depth":26,"bounds":{"left":0.78307843,"top":0.61851555,"width":0.050033245,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Share results","depth":27,"bounds":{"left":0.79704124,"top":0.62450117,"width":0.028756648,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Export results","depth":28,"bounds":{"left":0.83577126,"top":0.61851555,"width":0.052027926,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Export results","depth":29,"bounds":{"left":0.8430851,"top":0.62450117,"width":0.030751329,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Add to dashboard","depth":26,"bounds":{"left":0.89045876,"top":0.61851555,"width":0.054022606,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Showing 5 of 5 records matched","depth":29,"bounds":{"left":0.4865359,"top":0.6584198,"width":0.075465426,"height":0.016759777},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)","depth":29,"bounds":{"left":0.4381649,"top":0.6763767,"width":0.17204122,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Hide histogram","depth":26,"bounds":{"left":0.9665891,"top":0.65682364,"width":0.031083776,"height":0.03431764},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Hide histogram","depth":27,"bounds":{"left":0.9665891,"top":0.65881884,"width":0.027759308,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"Filter table results","depth":25,"bounds":{"left":0.08261303,"top":0.7765363,"width":0.21542554,"height":0.025538707},"on_screen":true,"help_text":"","placeholder":"Filter table results (case insensitive)...","role_description":"search text field","subrole":"AXSearchField","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Completed. Query executed for 78 log groups.","depth":19,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudShell","depth":12,"bounds":{"left":0.08494016,"top":0.9784517,"width":0.02642952,"height":0.015961692},"on_screen":true,"help_text":"Open CloudShell","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudShell","depth":14,"bounds":{"left":0.091921546,"top":0.98044693,"width":0.019448139,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Feedback","depth":11,"bounds":{"left":0.11968085,"top":0.980846,"width":0.017121011,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Feedback","depth":13,"bounds":{"left":0.11968085,"top":0.98044693,"width":0.017121011,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"©","depth":12,"bounds":{"left":0.8159907,"top":0.98044693,"width":0.004155585,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026","depth":12,"bounds":{"left":0.82014626,"top":0.98044693,"width":0.00930851,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":",","depth":12,"bounds":{"left":0.8294548,"top":0.98044693,"width":0.0019946808,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Amazon Web Services, Inc.","depth":12,"bounds":{"left":0.83144945,"top":0.98044693,"width":0.048038565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"or its affiliates.","depth":12,"bounds":{"left":0.88048536,"top":0.98044693,"width":0.026595745,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Privacy","depth":13,"bounds":{"left":0.91705453,"top":0.9796488,"width":0.014295213,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Privacy","depth":14,"bounds":{"left":0.9177194,"top":0.98044693,"width":0.012965426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Terms","depth":13,"bounds":{"left":0.9396609,"top":0.9796488,"width":0.012300532,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Terms","depth":14,"bounds":{"left":0.9403258,"top":0.98044693,"width":0.010970744,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Cookie preferences","depth":13,"bounds":{"left":0.9602726,"top":0.980846,"width":0.034408245,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
6780981576055161636
|
-272112794895568460
|
idle
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26614
|
1102
|
8
|
2026-05-12T12:48:10.633517+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590090633_m1.jpg...
|
Slack
|
releases (Channel) - Jiminny Inc - 4 new items - S releases (Channel) - Jiminny Inc - 4 new items - Slack...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Switch workspaces… (Jiminny Inc) Has new messages
Switch workspaces… (Jiminny Inc) Has new messages
Home
Home
DMs
DMs
Activity
Activity
Files
Files
Later
Later
More…
More
Unreads
Threads
Huddles
Drafts & sent
1
Directories
jiminny-x-integration-app
platform-inner-team
ai-chapter
alerts
backend
bugs
confusion-clinic
curiosity_lab
engineering
general
jiminny-bg
platform-tickets
product_launches
random
releases
sofia-office
support
thank-yous
the_people_of_jiminny
Galya Dimitrova
Steliyan Georgiev
Petko Kashinski
Aneliya Angelova
Stefka Stoyanova
Vasil Vasilev
Nikolay Ivanov
Aneliya Angelova
,
Nikolay Yankov
,
Steliyan Georgiev
Stoyan Tanev
Lukas Kovalik
you
Jira Cloud
Toast...
|
[{"role":"AXPopUpButton","text [{"role":"AXPopUpButton","text":"Switch workspaces… (Jiminny Inc) Has new messages","depth":14,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Home","depth":14,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXStaticText","text":"Home","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"DMs","depth":14,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"DMs","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Activity","depth":14,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Activity","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Files","depth":14,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Files","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Later","depth":14,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Later","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"More…","depth":14,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"More","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Unreads","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Threads","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Huddles","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Drafts & sent","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Directories","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"jiminny-x-integration-app","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"platform-inner-team","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-chapter","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"alerts","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"backend","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"bugs","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"confusion-clinic","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"curiosity_lab","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"engineering","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"general","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"jiminny-bg","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"platform-tickets","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"product_launches","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"random","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"releases","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"sofia-office","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"support","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"thank-yous","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"the_people_of_jiminny","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Galya Dimitrova","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Steliyan Georgiev","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Petko Kashinski","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Aneliya Angelova","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Stefka Stoyanova","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Vasil Vasilev","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Aneliya Angelova","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":",","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Nikolay Yankov","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":",","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Steliyan Georgiev","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Stoyan Tanev","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Lukas Kovalik","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"you","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Jira Cloud","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Toast","depth":23,"on_screen":true,"role_description":"text"}]...
|
-7967463552600857786
|
-4103372798534476125
|
app_switch
|
hybrid
|
NULL
|
Switch workspaces… (Jiminny Inc) Has new messages
Switch workspaces… (Jiminny Inc) Has new messages
Home
Home
DMs
DMs
Activity
Activity
Files
Files
Later
Later
More…
More
Unreads
Threads
Huddles
Drafts & sent
1
Directories
jiminny-x-integration-app
platform-inner-team
ai-chapter
alerts
backend
bugs
confusion-clinic
curiosity_lab
engineering
general
jiminny-bg
platform-tickets
product_launches
random
releases
sofia-office
support
thank-yous
the_people_of_jiminny
Galya Dimitrova
Steliyan Georgiev
Petko Kashinski
Aneliya Angelova
Stefka Stoyanova
Vasil Vasilev
Nikolay Ivanov
Aneliya Angelova
,
Nikolay Yankov
,
Steliyan Georgiev
Stoyan Tanev
Lukas Kovalik
you
Jira Cloud
Toast
SlackFileEditViewGoHistoryWindowHelpRetro - Platform • in 1 h 12 msshDOCKER• 81DEV (-zsh)О ₴2APP (-zsh)• *[EMAIL]@Lukas-Kovaliks-MacBook-Pro-Jiminny~/.screenpipe/data $ cd ..[EMAIL] $ nasAdm1n@DXP4800PLUS-B5F8: ~$cd/volumel/screenpipe/Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes 1ltotal26Gdrwxrwxrwx+1rootroot410 May1215:15drwxr-xr-xrootroot450 Apr2519:39drwxrwxrwx+1Adminadmin202 Apr2620:10drwxrwxrwx+1Adminadmin298 May1013:46drwxrwxrwx+Adminadmin144 May09:41drwxrwxrwx+1Admin admin70 May1013:47drwxrwxrwx+1Adminadmin164 Apr1116:51drwxrwxrwx+1rootroot5.1KMay1120:55-rwxrwxrwx+1rootroot31Apr1817:42app_settings.json1Adminadmin13G May1120:55archive.db-rwxrwxrwx+1Adminadmin11G May10-rwxrwxrwx+Adm1n admin 3.5G May1112:31archive.db-bak20:15db.sqlite-rwxrwxrwx+1Admin admin32K May1205:48db.sqlite-shm-rwxrwxrwx+ 1Admin admin0 Apr 26 17:17db.sqlite-wal1Admin admin11K May 12 09:09.DS_Store-rwxrwxrwx+ 1 Admin admin219 Apr24 19:33•gitignore-rwxrwxrWx+1 Admin admin0 Apr1317:21screenpipe.db-rwxrwxrwx+1 Admin admin 8.4K May12 15:15screenpipe_fts_migrate.sh-rwxrwxrwx+ 1 Admin admin32K May 11 20:48screenpipe_sync.sh-rwxrwxrwx+ 1 Admin admin20K May 10 13:06screenpipe_sync_updated.shAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe$ cp archive.dbarchive.db.bak-pre-installidAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes ./screenpipe_fts_migrate.sh archive.dbScreenpipe FTS migrationDB:archive.dbSize: 13G• ×4-zsh• ₴5|screenpipe"O 386ssh100% <78•Tue 12 May 15:48:1018187-zsh• *8|+• Creating install registry_installs table• Om01s• Adding install_id to base tablesvideo_chunksalready presentError: stepping, UNIQUEconstraintfailed: video_chunks.install_id, video_chunks.id (19)Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT * FROM_installs;"Adm1neDXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT install_id, COUNT(*) FROM frames GROUP BY install_id;"Error: in prepare, no such column: install_idSELECT install_id,COUNT(*) FROM frames GROUP BY install_id;^_-- error hereAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes |...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26615
|
1103
|
11
|
2026-05-12T12:48:10.648416+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590090648_m2.jpg...
|
Slack
|
releases (Channel) - Jiminny Inc - 4 new items - S releases (Channel) - Jiminny Inc - 4 new items - Slack...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Switch workspaces… (Jiminny Inc) Has new messages
Switch workspaces… (Jiminny Inc) Has new messages
Home
Home
DMs
DMs
Activity
Activity
Files
Files
Later
Later
More…
More
Unreads
Threads
Huddles
Drafts & sent
1
Directories
jiminny-x-integration-app
platform-inner-team
ai-chapter
alerts
backend
bugs
confusion-clinic
curiosity_lab
engineering
general
jiminny-bg
platform-tickets
product_launches
random
releases
sofia-office
support
thank-yous
the_people_of_jiminny
Galya Dimitrova
Steliyan Georgiev
Petko Kashinski
Aneliya Angelova
Stefka Stoyanova
Vasil Vasilev
Nikolay Ivanov
Aneliya Angelova
,
Nikolay Yankov
,
Steliyan Georgiev
Stoyan Tanev
Lukas Kovalik
you
Jira Cloud
Toast
Google Calendar
Messages
Messages
Files
Files
Bookmarks
Bookmarks
Add and Edit Channel Tabs
Canvas
List
Folder...
|
[{"role":"AXPopUpButton","text [{"role":"AXPopUpButton","text":"Switch workspaces… (Jiminny Inc) Has new messages","depth":14,"bounds":{"left":0.0056515955,"top":0.058260176,"width":0.011968086,"height":0.028731046},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Home","depth":14,"bounds":{"left":0.0029920214,"top":0.10055866,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXStaticText","text":"Home","depth":16,"bounds":{"left":0.0066489363,"top":0.13806863,"width":0.009973404,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"DMs","depth":14,"bounds":{"left":0.0029920214,"top":0.15482841,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"DMs","depth":16,"bounds":{"left":0.0076462766,"top":0.19233839,"width":0.007978723,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Activity","depth":14,"bounds":{"left":0.0029920214,"top":0.20909816,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Activity","depth":16,"bounds":{"left":0.004986702,"top":0.24660814,"width":0.012965426,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.005319149,"top":0.24660814,"width":0.0026595744,"height":0.011173184}},{"char_start":1,"char_count":7,"bounds":{"left":0.0076462766,"top":0.24660814,"width":0.010638298,"height":0.011173184}}],"role_description":"text"},{"role":"AXRadioButton","text":"Files","depth":14,"bounds":{"left":0.0029920214,"top":0.26336792,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Files","depth":16,"bounds":{"left":0.0076462766,"top":0.3008779,"width":0.0076462766,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.007978723,"top":0.3008779,"width":0.0019946808,"height":0.011173184}},{"char_start":1,"char_count":4,"bounds":{"left":0.009973404,"top":0.3008779,"width":0.0056515955,"height":0.011173184}}],"role_description":"text"},{"role":"AXRadioButton","text":"Later","depth":14,"bounds":{"left":0.0029920214,"top":0.31763768,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Later","depth":16,"bounds":{"left":0.00731383,"top":0.35514766,"width":0.008643617,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00731383,"top":0.35514766,"width":0.0019946808,"height":0.011173184}},{"char_start":1,"char_count":4,"bounds":{"left":0.00930851,"top":0.35514766,"width":0.0066489363,"height":0.011173184}}],"role_description":"text"},{"role":"AXRadioButton","text":"More…","depth":14,"bounds":{"left":0.0029920214,"top":0.3719074,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"More","depth":16,"bounds":{"left":0.006981383,"top":0.4094174,"width":0.008976064,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00731383,"top":0.4094174,"width":0.0033244682,"height":0.011173184}},{"char_start":1,"char_count":3,"bounds":{"left":0.010638298,"top":0.4094174,"width":0.0056515955,"height":0.011173184}}],"role_description":"text"},{"role":"AXStaticText","text":"Unreads","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Threads","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Huddles","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Drafts & sent","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Directories","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"jiminny-x-integration-app","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"platform-inner-team","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-chapter","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"alerts","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"backend","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"bugs","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"confusion-clinic","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"curiosity_lab","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"engineering","depth":23,"bounds":{"left":0.042220745,"top":0.09177973,"width":0.025598405,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"general","depth":23,"bounds":{"left":0.042220745,"top":0.10055866,"width":0.015957447,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.10055866,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":6,"bounds":{"left":0.04488032,"top":0.10055866,"width":0.013297873,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"jiminny-bg","depth":23,"bounds":{"left":0.042220745,"top":0.12290503,"width":0.022938829,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.12290503,"width":0.0013297872,"height":0.014365523}},{"char_start":1,"char_count":9,"bounds":{"left":0.043550532,"top":0.12290503,"width":0.021609042,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"platform-tickets","depth":23,"bounds":{"left":0.042220745,"top":0.1452514,"width":0.034906916,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.1452514,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045212764,"top":0.1452514,"width":0.031914894,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"product_launches","depth":23,"bounds":{"left":0.042220745,"top":0.16759777,"width":0.03856383,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.16759777,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045212764,"top":0.16759777,"width":0.03557181,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"random","depth":23,"bounds":{"left":0.042220745,"top":0.18994413,"width":0.01662234,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.18994413,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":5,"bounds":{"left":0.044215426,"top":0.18994413,"width":0.014960106,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"releases","depth":23,"bounds":{"left":0.042220745,"top":0.2122905,"width":0.01761968,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.2122905,"width":0.0016622341,"height":0.014365523}},{"char_start":1,"char_count":7,"bounds":{"left":0.043882977,"top":0.2122905,"width":0.015957447,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"sofia-office","depth":23,"bounds":{"left":0.042220745,"top":0.23463687,"width":0.024268618,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.23463687,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":11,"bounds":{"left":0.04454787,"top":0.23463687,"width":0.021941489,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"support","depth":23,"bounds":{"left":0.042220745,"top":0.25698325,"width":0.016954787,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.25698325,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":6,"bounds":{"left":0.04454787,"top":0.25698325,"width":0.01462766,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"thank-yous","depth":23,"bounds":{"left":0.042220745,"top":0.2793296,"width":0.024268618,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.2793296,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":9,"bounds":{"left":0.044215426,"top":0.2793296,"width":0.022606382,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"the_people_of_jiminny","depth":23,"bounds":{"left":0.042220745,"top":0.30167598,"width":0.04488032,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.30167598,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":20,"bounds":{"left":0.044215426,"top":0.30167598,"width":0.04720745,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Galya Dimitrova","depth":23,"bounds":{"left":0.042220745,"top":0.35434955,"width":0.034906916,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.35434955,"width":0.003656915,"height":0.014365523}},{"char_start":1,"char_count":14,"bounds":{"left":0.045877658,"top":0.35434955,"width":0.03158245,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Steliyan Georgiev","depth":23,"bounds":{"left":0.042220745,"top":0.37669593,"width":0.038231384,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.37669593,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":16,"bounds":{"left":0.04488032,"top":0.37669593,"width":0.03557181,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Petko Kashinski","depth":23,"bounds":{"left":0.042220745,"top":0.3990423,"width":0.034242023,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.3990423,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":14,"bounds":{"left":0.045212764,"top":0.3990423,"width":0.03158245,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Aneliya Angelova","depth":23,"bounds":{"left":0.042220745,"top":0.42138866,"width":0.03756649,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.42138866,"width":0.0033244682,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045545213,"top":0.42138866,"width":0.034242023,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Stefka Stoyanova","depth":23,"bounds":{"left":0.042220745,"top":0.44373503,"width":0.03756649,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.44373503,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.04488032,"top":0.44373503,"width":0.03523936,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Vasil Vasilev","depth":23,"bounds":{"left":0.042220745,"top":0.4660814,"width":0.026263298,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.4660814,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":12,"bounds":{"left":0.045212764,"top":0.4660814,"width":0.023271276,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":23,"bounds":{"left":0.042220745,"top":0.4884278,"width":0.031914894,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.4884278,"width":0.0039893617,"height":0.014365523}},{"char_start":1,"char_count":13,"bounds":{"left":0.046210106,"top":0.4884278,"width":0.027925532,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Aneliya Angelova","depth":23,"bounds":{"left":0.042220745,"top":0.51077414,"width":0.03756649,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.51077414,"width":0.0033244682,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045545213,"top":0.51077414,"width":0.034242023,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":",","depth":23,"bounds":{"left":0.07945479,"top":0.51077414,"width":0.0063164895,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Nikolay Yankov","depth":23,"bounds":{"left":0.08211436,"top":0.51077414,"width":0.014295213,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.08211436,"top":0.51077414,"width":0.0039893617,"height":0.014365523}},{"char_start":1,"char_count":13,"bounds":{"left":0.08610372,"top":0.51077414,"width":0.028922873,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":",","depth":23,"bounds":{"left":0.09607713,"top":0.528332,"width":0.0003324468,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Steliyan Georgiev","depth":23,"bounds":{"left":0.09607713,"top":0.528332,"width":0.0003324468,"height":0.0007980846},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.11735372,"top":0.51077414,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":16,"bounds":{"left":0.1200133,"top":0.51077414,"width":0.03557181,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Stoyan Tanev","depth":23,"bounds":{"left":0.042220745,"top":0.5331205,"width":0.028922873,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.5331205,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":11,"bounds":{"left":0.04488032,"top":0.5331205,"width":0.026263298,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Lukas Kovalik","depth":23,"bounds":{"left":0.042220745,"top":0.5554669,"width":0.02925532,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.5554669,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":12,"bounds":{"left":0.04488032,"top":0.5554669,"width":0.026928192,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"you","depth":23,"bounds":{"left":0.07413564,"top":0.5554669,"width":0.0063164895,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.07446808,"top":0.5554669,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":2,"bounds":{"left":0.07679521,"top":0.5554669,"width":0.0056515955,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Jira Cloud","depth":23,"bounds":{"left":0.042220745,"top":0.60814047,"width":0.021609042,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.60814047,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":9,"bounds":{"left":0.044215426,"top":0.60814047,"width":0.019946808,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Toast","depth":23,"bounds":{"left":0.042220745,"top":0.63048685,"width":0.011635638,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.63048685,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":4,"bounds":{"left":0.04454787,"top":0.63048685,"width":0.00930851,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Google Calendar","depth":23,"bounds":{"left":0.042220745,"top":0.6528332,"width":0.03025266,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.6528332,"width":0.003656915,"height":0.014365523}},{"char_start":1,"char_count":14,"bounds":{"left":0.045877658,"top":0.6528332,"width":0.032912236,"height":0.014365523}}],"role_description":"text"},{"role":"AXRadioButton","text":"Messages","depth":17,"bounds":{"left":0.10206117,"top":0.09177973,"width":0.030585106,"height":0.030327214},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXStaticText","text":"Messages","depth":19,"bounds":{"left":0.111369684,"top":0.10055866,"width":0.01861702,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.111369684,"top":0.10055866,"width":0.0039893617,"height":0.012769354}},{"char_start":1,"char_count":7,"bounds":{"left":0.115359046,"top":0.10055866,"width":0.014960106,"height":0.012769354}}],"role_description":"text"},{"role":"AXRadioButton","text":"Files","depth":17,"bounds":{"left":0.13397606,"top":0.09177973,"width":0.020944148,"height":0.030327214},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Files","depth":19,"bounds":{"left":0.14328457,"top":0.10055866,"width":0.008976064,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.14328457,"top":0.10055866,"width":0.0026595744,"height":0.012769354}},{"char_start":1,"char_count":4,"bounds":{"left":0.14594415,"top":0.10055866,"width":0.0063164895,"height":0.012769354}}],"role_description":"text"},{"role":"AXRadioButton","text":"Bookmarks","depth":17,"bounds":{"left":0.15591756,"top":0.09177973,"width":0.033909574,"height":0.030327214},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Bookmarks","depth":19,"bounds":{"left":0.16522606,"top":0.10055866,"width":0.021941489,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.16555852,"top":0.10055866,"width":0.0029920214,"height":0.012769354}},{"char_start":1,"char_count":8,"bounds":{"left":0.16821809,"top":0.10055866,"width":0.019281914,"height":0.012769354}}],"role_description":"text"},{"role":"AXPopUpButton","text":"Add and Edit Channel Tabs","depth":17,"bounds":{"left":0.19115691,"top":0.09177973,"width":0.010638298,"height":0.030327214},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Canvas","depth":17,"bounds":{"left":0.096409574,"top":0.0518755,"width":0.015625,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"List","depth":17,"bounds":{"left":0.096409574,"top":0.0518755,"width":0.0076462766,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Folder","depth":17,"bounds":{"left":0.096409574,"top":0.0518755,"width":0.013962766,"height":0.0007980846},"on_screen":true,"role_description":"text"}]...
|
-703298788733152535
|
-3527254682246603101
|
app_switch
|
hybrid
|
NULL
|
Switch workspaces… (Jiminny Inc) Has new messages
Switch workspaces… (Jiminny Inc) Has new messages
Home
Home
DMs
DMs
Activity
Activity
Files
Files
Later
Later
More…
More
Unreads
Threads
Huddles
Drafts & sent
1
Directories
jiminny-x-integration-app
platform-inner-team
ai-chapter
alerts
backend
bugs
confusion-clinic
curiosity_lab
engineering
general
jiminny-bg
platform-tickets
product_launches
random
releases
sofia-office
support
thank-yous
the_people_of_jiminny
Galya Dimitrova
Steliyan Georgiev
Petko Kashinski
Aneliya Angelova
Stefka Stoyanova
Vasil Vasilev
Nikolay Ivanov
Aneliya Angelova
,
Nikolay Yankov
,
Steliyan Georgiev
Stoyan Tanev
Lukas Kovalik
you
Jira Cloud
Toast
Google Calendar
Messages
Messages
Files
Files
Bookmarks
Bookmarks
Add and Edit Channel Tabs
Canvas
List
Folder
rireroxcalVIewhistorybookmarksProtllesWindowmelpTypeError: League|Flysystem|FileCa CloudWatch | us-east-2O Pipelines - jiminny/ap(UY-20725) (HubSpot) Optimise CIJy-20725 add HS rate limit handlinWJY-207731 User Pilot not receivini@Jy-20773 fix user pilot tracking for(JY-207761 Automated report - seJY-20725 add HS rate limit handlir$ (SRD-6793] Les Mills activity typePlattorm Team - Backloo - Jiralu Userpilot | Events— New TabTools-us-east-2#logsV2:logs-insights$3FqueryDetailS3D~(end~O~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds-editorStaws,[Option+5] @O) EC2B S3# CodeDeployCa Cloud\COs Aurora and RDSổ Amazon OpenSearch Ser..CloudFrontaia MediaLiveCloudWatch> Logs Insights• Query definition infoLog Analytics a unified observability platform for a smoother experience, now in preview mode. Click here to try it out!Ouery scopeLog groupsProperty selectonAll log groupsQ All log groups.fields @timestamp,(message, @logStream, @log"Tilter anessage likerlagering cventfor UserPilot tracking"@message not like /Analytic/ | filter @message not like /Transcript/tilter dmessage not like/wedhook,•Tilter dmessage not like /Meetinabot/•limit 10000Logs Insights QL½ Query gePSRun queryCancel• Completed. Query executed for 78 log grouLogs (5)Patterns (1)VisualizationLogs (5)$1Slack" Ketro - Platorm • In 1h 12 m100% 2&• Tue 12 May 15:48:10essace <e zu 4ulocstream <e 20 40100 va/c zutllel zu 4umessage zullke 20 zzirlegerine zucvent zuror zuuse5m30mAccount ID: 4103-4619-5943United States (Ohio) •PROD12hCustom #compare (Otr)UTC timezone * L Start tailingLog classAccountis)STANDARDVChange Accoun….All accounts XN* Investigate Y09:30Showing 5 of 5 records matched O23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)01:00101:3002:0002:30103:0003:3004:00|05:0005:3006:0006:3007:0007:30Q Filter table results (case insensitive)...©timestamp• 1 2026-05-12T10:47:09.311Z2026-05-12T10:04:46.728Z2026-05-12709:20:38.392Z2026-05-12T01•00•21 6697|6с 2026.05.12701•00-29 9947emessage®logStreamNOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking ("report_uuid":"23a4622e-3d94-. php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 |2ªNOTICE: PHP message: [2026-05-12 10:04:46] production. INFO: [Report Ready] Triggering Event for UserPilot tracking ("report_uuid": "2304622e-3d94- php-app/php-app/26f1c69abf0741C785f4eb93ad730784 L2NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-.. php-app/php-app/7c976ed843c0428faab97fad2f3421c2 L?NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid": "d08c3a32-01fc- php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Lª|NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116- php-app/php-app/81547f694a0345619f77bf95aaad3d08 L22 CloudShellFeedback08:00" Summarize results08:30elog410346195943: php-app410346195943:рhp-app410346195943:php-app410346195943:php-app410346195943:php-app09:00Share resultsExport results Add to dashboard11:30Hide histogram@ 2026. Amazon Weh Services Inc. or its affiliatesPrivacy TermsGookie nreferencec...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26616
|
1103
|
12
|
2026-05-12T12:48:12.184482+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590092184_m2.jpg...
|
Slack
|
releases (Channel) - Jiminny Inc - 4 new items - S releases (Channel) - Jiminny Inc - 4 new items - Slack...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Switch workspaces… (Jiminny Inc) Has new messages
Switch workspaces… (Jiminny Inc) Has new messages
Home
Home
DMs
DMs
Activity
Activity
Files
Files
Later
Later
More…
More
Unreads
Threads
Huddles
Drafts & sent
1
Directories
jiminny-x-integration-app
platform-inner-team
ai-chapter
alerts
backend
bugs
confusion-clinic
curiosity_lab
engineering
general
jiminny-bg
platform-tickets
product_launches
random
releases
sofia-office
support
thank-yous
the_people_of_jiminny
Galya Dimitrova
Steliyan Georgiev
Petko Kashinski
Aneliya Angelova
Stefka Stoyanova
Vasil Vasilev
Nikolay Ivanov
Aneliya Angelova
,
Nikolay Yankov
,
Steliyan Georgiev
Stoyan Tanev
Lukas Kovalik
you
Jira Cloud
Toast
Google Calendar
Messages
Messages
Files
Files
Bookmarks
Bookmarks
Add and Edit Channel Tabs
Canvas
List
Folder
Jump to date
GitHub
APP
Today at 2:14:55 PM
2:14 PM
4 new commits
4 new commits
pushed to
master
master
by
LakyLak
LakyLak
6bd41c89
6bd41c89
- JY-20773 fix user pilot tracking ofr automated report generated
5b2c9228
5b2c9228
- Merge branch 'master' into JY-20773-fix-automated-reports-user-pilot-tracking
62861fa2
62861fa2
- Merge branch 'master' into JY-20773-fix-automated-reports-user-pilot-tracking
a8b76812
a8b76812
- Merge pull request #12024 from jiminny/JY-20773-fix-automated-reports-user-pilot-tracking
jiminny/app
jiminny/app
|
Added by
GitHub
GitHub
CircleCI
APP
Today at 2:41:02 PM
2:41 PM
Deployment Successful! tada emoji
Deployment Successful!
Project
: app
When
: 05/12/2026 11:41:02
Tag
:
View Job
View Job
GitHub
APP
Today at 2:50:53 PM
2:50 PM
5 new commits
5 new commits
pushed to
master
master
by
ilian-jiminny
ilian-jiminny
1162b043
1162b043
- fix(security): bump dependencies (alerts #477)
2f0ca3a0
2f0ca3a0
- Merge branch 'master' into secfix/composer-20260507
f861c9e7
f861c9e7
- Merge branch 'master' into secfix/composer-20260507
9b89679e
9b89679e
- Merge branch 'master' into secfix/composer-20260507
4cb55bd1
4cb55bd1
- Merge pull request #12049 from jiminny/secfix/composer-20260507
jiminny/app
jiminny/app
|
Added by
GitHub
GitHub
React with white_check_mark
React with eyes
React with raised_hands
Add reaction…
Reply in thread
Forward message…
Save for later
More actions
New
CircleCI
APP
Today at 3:17:32 PM
3:17 PM
Deployment Successful! tada emoji
Deployment Successful!
Project
: app
When
: 05/12/2026 12:17:31
Tag
:
View Job
View Job
React with white_check_mark
React with eyes
React with raised_hands
Add reaction…
Reply in thread
Forward message…
Save for later
More actions
Processing uploaded file… complete! Message ready to be sent.
Channel releases...
|
[{"role":"AXPopUpButton","text [{"role":"AXPopUpButton","text":"Switch workspaces… (Jiminny Inc) Has new messages","depth":14,"bounds":{"left":0.0056515955,"top":0.058260176,"width":0.011968086,"height":0.028731046},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Home","depth":14,"bounds":{"left":0.0029920214,"top":0.10055866,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXStaticText","text":"Home","depth":16,"bounds":{"left":0.0066489363,"top":0.13806863,"width":0.009973404,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"DMs","depth":14,"bounds":{"left":0.0029920214,"top":0.15482841,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"DMs","depth":16,"bounds":{"left":0.0076462766,"top":0.19233839,"width":0.007978723,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Activity","depth":14,"bounds":{"left":0.0029920214,"top":0.20909816,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Activity","depth":16,"bounds":{"left":0.004986702,"top":0.24660814,"width":0.012965426,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.005319149,"top":0.24660814,"width":0.0026595744,"height":0.011173184}},{"char_start":1,"char_count":7,"bounds":{"left":0.0076462766,"top":0.24660814,"width":0.010638298,"height":0.011173184}}],"role_description":"text"},{"role":"AXRadioButton","text":"Files","depth":14,"bounds":{"left":0.0029920214,"top":0.26336792,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Files","depth":16,"bounds":{"left":0.0076462766,"top":0.3008779,"width":0.0076462766,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.007978723,"top":0.3008779,"width":0.0019946808,"height":0.011173184}},{"char_start":1,"char_count":4,"bounds":{"left":0.009973404,"top":0.3008779,"width":0.0056515955,"height":0.011173184}}],"role_description":"text"},{"role":"AXRadioButton","text":"Later","depth":14,"bounds":{"left":0.0029920214,"top":0.31763768,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Later","depth":16,"bounds":{"left":0.00731383,"top":0.35514766,"width":0.008643617,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00731383,"top":0.35514766,"width":0.0019946808,"height":0.011173184}},{"char_start":1,"char_count":4,"bounds":{"left":0.00930851,"top":0.35514766,"width":0.0066489363,"height":0.011173184}}],"role_description":"text"},{"role":"AXRadioButton","text":"More…","depth":14,"bounds":{"left":0.0029920214,"top":0.3719074,"width":0.017287234,"height":0.054269753},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"More","depth":16,"bounds":{"left":0.006981383,"top":0.4094174,"width":0.008976064,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00731383,"top":0.4094174,"width":0.0033244682,"height":0.011173184}},{"char_start":1,"char_count":3,"bounds":{"left":0.010638298,"top":0.4094174,"width":0.0056515955,"height":0.011173184}}],"role_description":"text"},{"role":"AXStaticText","text":"Unreads","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Threads","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Huddles","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Drafts & sent","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Directories","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"jiminny-x-integration-app","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"platform-inner-team","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-chapter","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"alerts","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"backend","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"bugs","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"confusion-clinic","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"curiosity_lab","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"engineering","depth":23,"bounds":{"left":0.042220745,"top":0.09177973,"width":0.025598405,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"general","depth":23,"bounds":{"left":0.042220745,"top":0.10055866,"width":0.015957447,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.10055866,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":6,"bounds":{"left":0.04488032,"top":0.10055866,"width":0.013297873,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"jiminny-bg","depth":23,"bounds":{"left":0.042220745,"top":0.12290503,"width":0.022938829,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.12290503,"width":0.0013297872,"height":0.014365523}},{"char_start":1,"char_count":9,"bounds":{"left":0.043550532,"top":0.12290503,"width":0.021609042,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"platform-tickets","depth":23,"bounds":{"left":0.042220745,"top":0.1452514,"width":0.034906916,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.1452514,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045212764,"top":0.1452514,"width":0.031914894,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"product_launches","depth":23,"bounds":{"left":0.042220745,"top":0.16759777,"width":0.03856383,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.16759777,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045212764,"top":0.16759777,"width":0.03557181,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"random","depth":23,"bounds":{"left":0.042220745,"top":0.18994413,"width":0.01662234,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.18994413,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":5,"bounds":{"left":0.044215426,"top":0.18994413,"width":0.014960106,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"releases","depth":23,"bounds":{"left":0.042220745,"top":0.2122905,"width":0.01761968,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.2122905,"width":0.0016622341,"height":0.014365523}},{"char_start":1,"char_count":7,"bounds":{"left":0.043882977,"top":0.2122905,"width":0.015957447,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"sofia-office","depth":23,"bounds":{"left":0.042220745,"top":0.23463687,"width":0.024268618,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.23463687,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":11,"bounds":{"left":0.04454787,"top":0.23463687,"width":0.021941489,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"support","depth":23,"bounds":{"left":0.042220745,"top":0.25698325,"width":0.016954787,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.25698325,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":6,"bounds":{"left":0.04454787,"top":0.25698325,"width":0.01462766,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"thank-yous","depth":23,"bounds":{"left":0.042220745,"top":0.2793296,"width":0.024268618,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.2793296,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":9,"bounds":{"left":0.044215426,"top":0.2793296,"width":0.022606382,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"the_people_of_jiminny","depth":23,"bounds":{"left":0.042220745,"top":0.30167598,"width":0.04488032,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.30167598,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":20,"bounds":{"left":0.044215426,"top":0.30167598,"width":0.04720745,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Galya Dimitrova","depth":23,"bounds":{"left":0.042220745,"top":0.35434955,"width":0.034906916,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.35434955,"width":0.003656915,"height":0.014365523}},{"char_start":1,"char_count":14,"bounds":{"left":0.045877658,"top":0.35434955,"width":0.03158245,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Steliyan Georgiev","depth":23,"bounds":{"left":0.042220745,"top":0.37669593,"width":0.038231384,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.37669593,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":16,"bounds":{"left":0.04488032,"top":0.37669593,"width":0.03557181,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Petko Kashinski","depth":23,"bounds":{"left":0.042220745,"top":0.3990423,"width":0.034242023,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.3990423,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":14,"bounds":{"left":0.045212764,"top":0.3990423,"width":0.03158245,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Aneliya Angelova","depth":23,"bounds":{"left":0.042220745,"top":0.42138866,"width":0.03756649,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.42138866,"width":0.0033244682,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045545213,"top":0.42138866,"width":0.034242023,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Stefka Stoyanova","depth":23,"bounds":{"left":0.042220745,"top":0.44373503,"width":0.03756649,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.44373503,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.04488032,"top":0.44373503,"width":0.03523936,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Vasil Vasilev","depth":23,"bounds":{"left":0.042220745,"top":0.4660814,"width":0.026263298,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.4660814,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":12,"bounds":{"left":0.045212764,"top":0.4660814,"width":0.023271276,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":23,"bounds":{"left":0.042220745,"top":0.4884278,"width":0.031914894,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.4884278,"width":0.0039893617,"height":0.014365523}},{"char_start":1,"char_count":13,"bounds":{"left":0.046210106,"top":0.4884278,"width":0.027925532,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Aneliya Angelova","depth":23,"bounds":{"left":0.042220745,"top":0.51077414,"width":0.03756649,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.51077414,"width":0.0033244682,"height":0.014365523}},{"char_start":1,"char_count":15,"bounds":{"left":0.045545213,"top":0.51077414,"width":0.034242023,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":",","depth":23,"bounds":{"left":0.07945479,"top":0.51077414,"width":0.0063164895,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Nikolay Yankov","depth":23,"bounds":{"left":0.08211436,"top":0.51077414,"width":0.014295213,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.08211436,"top":0.51077414,"width":0.0039893617,"height":0.014365523}},{"char_start":1,"char_count":13,"bounds":{"left":0.08610372,"top":0.51077414,"width":0.028922873,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":",","depth":23,"bounds":{"left":0.09607713,"top":0.528332,"width":0.0003324468,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Steliyan Georgiev","depth":23,"bounds":{"left":0.09607713,"top":0.528332,"width":0.0003324468,"height":0.0007980846},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.11735372,"top":0.51077414,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":16,"bounds":{"left":0.1200133,"top":0.51077414,"width":0.03557181,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Stoyan Tanev","depth":23,"bounds":{"left":0.042220745,"top":0.5331205,"width":0.028922873,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.5331205,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":11,"bounds":{"left":0.04488032,"top":0.5331205,"width":0.026263298,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Lukas Kovalik","depth":23,"bounds":{"left":0.042220745,"top":0.5554669,"width":0.02925532,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.5554669,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":12,"bounds":{"left":0.04488032,"top":0.5554669,"width":0.026928192,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"you","depth":23,"bounds":{"left":0.07413564,"top":0.5554669,"width":0.0063164895,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.07446808,"top":0.5554669,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":2,"bounds":{"left":0.07679521,"top":0.5554669,"width":0.0056515955,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Jira Cloud","depth":23,"bounds":{"left":0.042220745,"top":0.60814047,"width":0.021609042,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.60814047,"width":0.0019946808,"height":0.014365523}},{"char_start":1,"char_count":9,"bounds":{"left":0.044215426,"top":0.60814047,"width":0.019946808,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Toast","depth":23,"bounds":{"left":0.042220745,"top":0.63048685,"width":0.011635638,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.63048685,"width":0.0023271276,"height":0.014365523}},{"char_start":1,"char_count":4,"bounds":{"left":0.04454787,"top":0.63048685,"width":0.00930851,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"Google Calendar","depth":23,"bounds":{"left":0.042220745,"top":0.6528332,"width":0.03025266,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.042220745,"top":0.6528332,"width":0.003656915,"height":0.014365523}},{"char_start":1,"char_count":14,"bounds":{"left":0.045877658,"top":0.6528332,"width":0.032912236,"height":0.014365523}}],"role_description":"text"},{"role":"AXRadioButton","text":"Messages","depth":17,"bounds":{"left":0.10206117,"top":0.09177973,"width":0.030585106,"height":0.030327214},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXStaticText","text":"Messages","depth":19,"bounds":{"left":0.111369684,"top":0.10055866,"width":0.01861702,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.111369684,"top":0.10055866,"width":0.0039893617,"height":0.012769354}},{"char_start":1,"char_count":7,"bounds":{"left":0.115359046,"top":0.10055866,"width":0.014960106,"height":0.012769354}}],"role_description":"text"},{"role":"AXRadioButton","text":"Files","depth":17,"bounds":{"left":0.13397606,"top":0.09177973,"width":0.020944148,"height":0.030327214},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Files","depth":19,"bounds":{"left":0.14328457,"top":0.10055866,"width":0.008976064,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.14328457,"top":0.10055866,"width":0.0026595744,"height":0.012769354}},{"char_start":1,"char_count":4,"bounds":{"left":0.14594415,"top":0.10055866,"width":0.0063164895,"height":0.012769354}}],"role_description":"text"},{"role":"AXRadioButton","text":"Bookmarks","depth":17,"bounds":{"left":0.15591756,"top":0.09177973,"width":0.033909574,"height":0.030327214},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Bookmarks","depth":19,"bounds":{"left":0.16522606,"top":0.10055866,"width":0.021941489,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.16555852,"top":0.10055866,"width":0.0029920214,"height":0.012769354}},{"char_start":1,"char_count":8,"bounds":{"left":0.16821809,"top":0.10055866,"width":0.019281914,"height":0.012769354}}],"role_description":"text"},{"role":"AXPopUpButton","text":"Add and Edit Channel Tabs","depth":17,"bounds":{"left":0.19115691,"top":0.09177973,"width":0.010638298,"height":0.030327214},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Canvas","depth":17,"bounds":{"left":0.096409574,"top":0.0518755,"width":0.015625,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"List","depth":17,"bounds":{"left":0.096409574,"top":0.0518755,"width":0.0076462766,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Folder","depth":17,"bounds":{"left":0.096409574,"top":0.0518755,"width":0.013962766,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXPopUpButton","text":"Jump to date","depth":22,"bounds":{"left":0.14594415,"top":0.12689546,"width":0.025265958,"height":0.022346368},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"GitHub","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"APP","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"Today at 2:14:55 PM","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2:14 PM","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"4 new commits","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4 new commits","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pushed to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"master","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"master","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"LakyLak","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"LakyLak","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"6bd41c89","depth":26,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"6bd41c89","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"- JY-20773 fix user pilot tracking ofr automated report generated","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"5b2c9228","depth":26,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5b2c9228","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"- Merge branch 'master' into JY-20773-fix-automated-reports-user-pilot-tracking","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"62861fa2","depth":26,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"62861fa2","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"- Merge branch 'master' into JY-20773-fix-automated-reports-user-pilot-tracking","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"a8b76812","depth":26,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"a8b76812","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"- Merge pull request #12024 from jiminny/JY-20773-fix-automated-reports-user-pilot-tracking","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"jiminny/app","depth":25,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"jiminny/app","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"|","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added by","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"GitHub","depth":25,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"GitHub","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"CircleCI","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"APP","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"Today at 2:41:02 PM","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2:41 PM","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"Deployment Successful! tada emoji","depth":23,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"Deployment Successful!","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Project","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":": app","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"When","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":": 05/12/2026 11:41:02","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Tag","depth":24,"bounds":{"left":0.11801862,"top":0.11572227,"width":0.0076462766,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.11801862,"top":0.11412609,"width":0.0026595744,"height":0.014365523}},{"char_start":1,"char_count":2,"bounds":{"left":0.120678194,"top":0.11412609,"width":0.004986702,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":":","depth":24,"bounds":{"left":0.12533244,"top":0.11572227,"width":0.0016622341,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"View Job","depth":24,"bounds":{"left":0.11801862,"top":0.14285715,"width":0.023271276,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"View Job","depth":26,"bounds":{"left":0.12101064,"top":0.14684756,"width":0.017287234,"height":0.012769354},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.12101064,"top":0.14764565,"width":0.0029920214,"height":0.012769354}},{"char_start":1,"char_count":7,"bounds":{"left":0.12400266,"top":0.14764565,"width":0.01462766,"height":0.012769354}}],"role_description":"text"},{"role":"AXButton","text":"GitHub","depth":23,"bounds":{"left":0.11801862,"top":0.17478053,"width":0.016289894,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"APP","depth":23,"bounds":{"left":0.13663563,"top":0.17877094,"width":0.0066489363,"height":0.009577015},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.14394946,"top":0.1763767,"width":0.0026595744,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"Today at 2:50:53 PM","depth":23,"bounds":{"left":0.14660904,"top":0.17877094,"width":0.015292553,"height":0.011173184},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2:50 PM","depth":24,"bounds":{"left":0.14660904,"top":0.17877094,"width":0.015292553,"height":0.011173184},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.14660904,"top":0.17877094,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":6,"bounds":{"left":0.14893617,"top":0.17877094,"width":0.012965426,"height":0.011971269}}],"role_description":"text"},{"role":"AXLink","text":"5 new commits","depth":23,"bounds":{"left":0.11801862,"top":0.19393456,"width":0.03324468,"height":0.014365523},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5 new commits","depth":24,"bounds":{"left":0.11801862,"top":0.19393456,"width":0.03324468,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.11801862,"top":0.19393456,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":12,"bounds":{"left":0.12101064,"top":0.19393456,"width":0.03025266,"height":0.014365523}}],"role_description":"text"},{"role":"AXStaticText","text":"pushed to","depth":23,"bounds":{"left":0.15093085,"top":0.19393456,"width":0.024601065,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.1512633,"top":0.19393456,"width":0.0013297872,"height":0.014365523}},{"char_start":1,"char_count":8,"bounds":{"left":0.15259309,"top":0.19393456,"width":0.018949468,"height":0.014365523}}],"role_description":"text"},{"role":"AXLink","text":"master","depth":24,"bounds":{"left":0.1768617,"top":0.1963288,"width":0.014295213,"height":0.011971269},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"master","depth":25,"bounds":{"left":0.1768617,"top":0.1963288,"width":0.014295213,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.1768617,"top":0.1963288,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":5,"bounds":{"left":0.17918883,"top":0.1963288,"width":0.012300532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"by","depth":23,"bounds":{"left":0.1924867,"top":0.19393456,"width":0.007978723,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"ilian-jiminny","depth":23,"bounds":{"left":0.11801862,"top":0.19393456,"width":0.0930851,"height":0.031923383},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ilian-jiminny","depth":24,"bounds":{"left":0.11801862,"top":0.19393456,"width":0.0930851,"height":0.031923383},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.20046543,"top":0.19393456,"width":0.0013297872,"height":0.014365523}},{"char_start":1,"char_count":12,"bounds":{"left":0.11801862,"top":0.19393456,"width":0.0930851,"height":0.031923383}}],"role_description":"text"},{"role":"AXLink","text":"1162b043","depth":26,"bounds":{"left":0.124667555,"top":0.23782921,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"1162b043","depth":27,"bounds":{"left":0.124667555,"top":0.23782921,"width":0.019281914,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.124667555,"top":0.23782921,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.12699468,"top":0.23782921,"width":0.016954787,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"- fix(security): bump dependencies (alerts #477)","depth":25,"bounds":{"left":0.12333777,"top":0.23543495,"width":0.06648936,"height":0.031923383},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.14527926,"top":0.23543495,"width":0.0013297872,"height":0.014365523}},{"char_start":1,"char_count":47,"bounds":{"left":0.12333777,"top":0.23543495,"width":0.06648936,"height":0.031923383}}],"role_description":"text"},{"role":"AXLink","text":"2f0ca3a0","depth":26,"bounds":{"left":0.124667555,"top":0.27294493,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"2f0ca3a0","depth":27,"bounds":{"left":0.124667555,"top":0.27294493,"width":0.019281914,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.124667555,"top":0.27294493,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.12699468,"top":0.27294493,"width":0.016954787,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"- Merge branch 'master' into secfix/composer-20260507","depth":25,"bounds":{"left":0.12333777,"top":0.27055067,"width":0.084773935,"height":0.031923383},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"f861c9e7","depth":26,"bounds":{"left":0.124667555,"top":0.30806065,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"f861c9e7","depth":27,"bounds":{"left":0.124667555,"top":0.30806065,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"- Merge branch 'master' into secfix/composer-20260507","depth":25,"bounds":{"left":0.12333777,"top":0.3056664,"width":0.084773935,"height":0.031923383},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"9b89679e","depth":26,"bounds":{"left":0.124667555,"top":0.34317636,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"9b89679e","depth":27,"bounds":{"left":0.124667555,"top":0.34317636,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"- Merge branch 'master' into secfix/composer-20260507","depth":25,"bounds":{"left":0.12333777,"top":0.34078214,"width":0.084773935,"height":0.031923383},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"4cb55bd1","depth":26,"bounds":{"left":0.124667555,"top":0.3782921,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4cb55bd1","depth":27,"bounds":{"left":0.124667555,"top":0.3782921,"width":0.019281914,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"- Merge pull request #12049 from jiminny/secfix/composer-20260507","depth":25,"bounds":{"left":0.12333777,"top":0.37589785,"width":0.08610372,"height":0.049481247},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"jiminny/app","depth":25,"bounds":{"left":0.1299867,"top":0.4309657,"width":0.020611702,"height":0.011173184},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"jiminny/app","depth":26,"bounds":{"left":0.1299867,"top":0.4309657,"width":0.020611702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"|","depth":25,"bounds":{"left":0.15026596,"top":0.4309657,"width":0.0033244682,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Added by","depth":25,"bounds":{"left":0.15325798,"top":0.4309657,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"GitHub","depth":25,"bounds":{"left":0.17087767,"top":0.4309657,"width":0.012965426,"height":0.011173184},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"GitHub","depth":26,"bounds":{"left":0.17087767,"top":0.4309657,"width":0.012965426,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXCheckBox","text":"React with white_check_mark","depth":25,"bounds":{"left":0.12865691,"top":0.16121309,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"React with eyes","depth":25,"bounds":{"left":0.1392952,"top":0.16121309,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"React with raised_hands","depth":25,"bounds":{"left":0.14993352,"top":0.16121309,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Add reaction…","depth":25,"bounds":{"left":0.16057181,"top":0.16121309,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Reply in thread","depth":25,"bounds":{"left":0.17121011,"top":0.16121309,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Forward message…","depth":25,"bounds":{"left":0.1818484,"top":0.16121309,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Save for later","depth":25,"bounds":{"left":0.21476063,"top":0.16121309,"width":0.0003324468,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More actions","depth":25,"bounds":{"left":0.21476063,"top":0.16121309,"width":0.0003324468,"height":0.025538707},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"New","depth":21,"bounds":{"left":0.20478724,"top":0.44373503,"width":0.00930851,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"CircleCI","depth":23,"bounds":{"left":0.11801862,"top":0.45411015,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"APP","depth":23,"bounds":{"left":0.13796543,"top":0.45810056,"width":0.0066489363,"height":0.009577015},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.14527926,"top":0.4557063,"width":0.0026595744,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXLink","text":"Today at 3:17:32 PM","depth":23,"bounds":{"left":0.14793883,"top":0.45810056,"width":0.015292553,"height":0.011173184},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"3:17 PM","depth":24,"bounds":{"left":0.14793883,"top":0.45810056,"width":0.015292553,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Deployment Successful! tada emoji","depth":23,"bounds":{"left":0.11801862,"top":0.47486034,"width":0.095744684,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"Deployment Successful!","depth":25,"bounds":{"left":0.11801862,"top":0.4764565,"width":0.054853722,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Project","depth":24,"bounds":{"left":0.11801862,"top":0.50359136,"width":0.015957447,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":": app","depth":24,"bounds":{"left":0.11801862,"top":0.50359136,"width":0.017287234,"height":0.031923383},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"When","depth":24,"bounds":{"left":0.14926861,"top":0.50359136,"width":0.013630319,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":": 05/12/2026 12:17:31","depth":24,"bounds":{"left":0.14926861,"top":0.50359136,"width":0.024601065,"height":0.049481247},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Tag","depth":24,"bounds":{"left":0.11801862,"top":0.55626494,"width":0.0076462766,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":":","depth":24,"bounds":{"left":0.12533244,"top":0.55626494,"width":0.0016622341,"height":0.014365523},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"View Job","depth":24,"bounds":{"left":0.11801862,"top":0.584996,"width":0.023271276,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"View Job","depth":26,"bounds":{"left":0.12101064,"top":0.58898646,"width":0.017287234,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXCheckBox","text":"React with white_check_mark","depth":25,"bounds":{"left":0.12865691,"top":0.4405427,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"React with eyes","depth":25,"bounds":{"left":0.1392952,"top":0.4405427,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"React with raised_hands","depth":25,"bounds":{"left":0.14993352,"top":0.4405427,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Add reaction…","depth":25,"bounds":{"left":0.16057181,"top":0.4405427,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Reply in thread","depth":25,"bounds":{"left":0.17121011,"top":0.4405427,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Forward message…","depth":25,"bounds":{"left":0.1818484,"top":0.4405427,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXCheckBox","text":"Save for later","depth":25,"bounds":{"left":0.21476063,"top":0.4405427,"width":0.0003324468,"height":0.025538707},"on_screen":true,"role_description":"toggle button","subrole":"AXToggleButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More actions","depth":25,"bounds":{"left":0.21476063,"top":0.4405427,"width":0.0003324468,"height":0.025538707},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"","depth":23,"bounds":{"left":0.10372341,"top":0.6272945,"width":0.109707445,"height":0.030327214},"on_screen":true,"value":"","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Processing uploaded file… complete! Message ready to be sent.","depth":11,"bounds":{"left":0.0,"top":0.7126895,"width":0.022606382,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Channel releases","depth":11,"bounds":{"left":0.0,"top":0.7126895,"width":0.017287234,"height":0.0007980846},"on_screen":true,"role_description":"text"}]...
|
-1370750380520237335
|
-3568657452915442607
|
visual_change
|
hybrid
|
NULL
|
Switch workspaces… (Jiminny Inc) Has new messages
Switch workspaces… (Jiminny Inc) Has new messages
Home
Home
DMs
DMs
Activity
Activity
Files
Files
Later
Later
More…
More
Unreads
Threads
Huddles
Drafts & sent
1
Directories
jiminny-x-integration-app
platform-inner-team
ai-chapter
alerts
backend
bugs
confusion-clinic
curiosity_lab
engineering
general
jiminny-bg
platform-tickets
product_launches
random
releases
sofia-office
support
thank-yous
the_people_of_jiminny
Galya Dimitrova
Steliyan Georgiev
Petko Kashinski
Aneliya Angelova
Stefka Stoyanova
Vasil Vasilev
Nikolay Ivanov
Aneliya Angelova
,
Nikolay Yankov
,
Steliyan Georgiev
Stoyan Tanev
Lukas Kovalik
you
Jira Cloud
Toast
Google Calendar
Messages
Messages
Files
Files
Bookmarks
Bookmarks
Add and Edit Channel Tabs
Canvas
List
Folder
Jump to date
GitHub
APP
Today at 2:14:55 PM
2:14 PM
4 new commits
4 new commits
pushed to
master
master
by
LakyLak
LakyLak
6bd41c89
6bd41c89
- JY-20773 fix user pilot tracking ofr automated report generated
5b2c9228
5b2c9228
- Merge branch 'master' into JY-20773-fix-automated-reports-user-pilot-tracking
62861fa2
62861fa2
- Merge branch 'master' into JY-20773-fix-automated-reports-user-pilot-tracking
a8b76812
a8b76812
- Merge pull request #12024 from jiminny/JY-20773-fix-automated-reports-user-pilot-tracking
jiminny/app
jiminny/app
|
Added by
GitHub
GitHub
CircleCI
APP
Today at 2:41:02 PM
2:41 PM
Deployment Successful! tada emoji
Deployment Successful!
Project
: app
When
: 05/12/2026 11:41:02
Tag
:
View Job
View Job
GitHub
APP
Today at 2:50:53 PM
2:50 PM
5 new commits
5 new commits
pushed to
master
master
by
ilian-jiminny
ilian-jiminny
1162b043
1162b043
- fix(security): bump dependencies (alerts #477)
2f0ca3a0
2f0ca3a0
- Merge branch 'master' into secfix/composer-20260507
f861c9e7
f861c9e7
- Merge branch 'master' into secfix/composer-20260507
9b89679e
9b89679e
- Merge branch 'master' into secfix/composer-20260507
4cb55bd1
4cb55bd1
- Merge pull request #12049 from jiminny/secfix/composer-20260507
jiminny/app
jiminny/app
|
Added by
GitHub
GitHub
React with white_check_mark
React with eyes
React with raised_hands
Add reaction…
Reply in thread
Forward message…
Save for later
More actions
New
CircleCI
APP
Today at 3:17:32 PM
3:17 PM
Deployment Successful! tada emoji
Deployment Successful!
Project
: app
When
: 05/12/2026 12:17:31
Tag
:
View Job
View Job
React with white_check_mark
React with eyes
React with raised_hands
Add reaction…
Reply in thread
Forward message…
Save for later
More actions
Processing uploaded file… complete! Message ready to be sent.
Channel releases
ActivityMoreslackcalVIewJiminny... ~# general# jiminny-bg# plattorm-tickets# product launches¿randomi# releases# sofia-office# support# thank-yous#t the people of iimi..o Direct messagesP. Galya Dimitrovao Steliyan GeorgievP Petko Kashinski. Aneliya Angelova8 Stefka Stovanovae Vasil Vasilev DNikolay Ivanov3 Aneliva Angelova…Stoyan Taneve Lukas Kovalik v..::: Apps' Jira CloudI& Toast(m) Google Cale.MistonWindowHelp@ Describe what you are looking forw releases9 22Messagesr Files• BookmarksView JobGitHub APP 2:50 PM5 new commits oushed to master ov ilian-jiminny11626643 - hx securitv: bumodevendencies alerts #4772f0ca3a0 - Merge branch 'master' intosechx/comboser-20260507f861c9e7 - Merge branch 'master" intosechy/comnoser-202605070h89670e - Merge hranch "master" intosechx/comnoser-202605074cb55bd1 - Merge pull request #12049from jiminny/secfx/composer-20260507@ jiminny/app Added by GitHubCircleCl APP 3:17 PMO Denloyment SuccessfullSProlect.When:05/12/202012:1/:31Tag,View JobMessage #releases+ Aa I01:00|02:00• Filter table results (case insensitive)...©timestampemessageinsights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit-[Option+S] CCOs Aurora and RDSLã Amazon OpenSearch Ser...© CloudFront 6 MediaLivebservability plattorm for a smoother experience, now in preview mode. Click here to try it out!ilot tracking"ssage not like /Iranscript.sage not like /Meetinabot_ Saved and sample queries? Query commands02:30103:0003:3004:00|05:00Showing 5 of 5 records matched ©23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)05:30106:0006:3007:0007:3008:00®logStream2026-05-12T10:47:09.311ZNOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-... php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 |22026-05-12T10:04:46.728Z2026-05-12709•20:38. 39272026-05-12T01•00•21 6697|NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-... php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 L?NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-.. php-app/php-app/7c976ed843c0428faab97fad2f3421c2 L?NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-. php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Lª2026.05.12701•00-29 9947NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-.. php-app/php-app/81547f694a0345619f77bf95aaad3d08 |2GloudShelllFeedhack5m# Summarize results)08:30elog410346195943:php-apr410346195943:рhp-app410346195943:phn-aon410346195943:php-app410346195943:php-app09:00hhl30m12hRetro - Platform - in 1h 12 m100% Lz• Tue 12 May 15:48:11Account ID: 4103-4619-5943 vUnited States (Ohio)Custom#Compare (Off)UTC timezone * L Start tailingLoa classAccountis)STANDARDChanae Accoun...YAll accounts X• Investigate ™F Share resultsExport results( Addto dashboard09:3010:30111:0011:3012:00Hide histogram12:30@ 2026. Amazon Weh Services Inc. or its affiliatesPrivacy Terms Cookie preferences...
|
26615
|
NULL
|
NULL
|
NULL
|
|
26618
|
1102
|
9
|
2026-05-12T12:48:15.680368+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590095680_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true}]...
|
6608878164049425507
|
788504611815491336
|
app_switch
|
hybrid
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
SlackFileEditViewG Explorer (⇧⌘E) - 1 unsaved file
SlackFileEditViewGoHistoryWindowHelpRetro - Platform • in 1 h 12 msshDOCKER• 81DEV (-zsh)О ₴2APP (-zsh)• *[EMAIL]@Lukas-Kovaliks-MacBook-Pro-Jiminny~/.screenpipe/data $ cd ..[EMAIL] $ nasAdm1n@DXP4800PLUS-B5F8: ~$cd/volumel/screenpipe/Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes 1ltotal26Gdrwxrwxrwx+1rootroot410 May1215:15drwxr-xr-xrootroot450 Apr2519:39drwxrwxrwx+1Adminadmin202 Apr2620:10drwxrwxrwx+1Adminadmin298 May1013:46drwxrwxrwx+Adminadmin144 May09:41drwxrwxrwx+1Admin admin70 May1013:47drwxrwxrwx+1Adminadmin164 Apr1116:51drwxrwxrwx+1rootroot5.1KMay1120:55-rwxrwxrwx+1rootroot31Apr1817:42app_settings.json1Adminadmin13G May1120:55archive.db-rwxrwxrwx+1Adminadmin11G May10-rwxrwxrwx+Adm1n admin 3.5G May1112:31archive.db-bak20:15db.sqlite-rwxrwxrwx+1Admin admin32K May1205:48db.sqlite-shm-rwxrwxrwx+ 1Admin admin0 Apr 26 17:17db.sqlite-wal1Admin admin11K May 12 09:09.DS_Store-rwxrwxrwx+ 1 Admin admin219 Apr24 19:33•gitignore-rwxrwxrWx+1 Admin admin0 Apr1317:21screenpipe.db-rwxrwxrwx+1 Admin admin 8.4K May12 15:15screenpipe_fts_migrate.sh-rwxrwxrwx+ 1 Admin admin32K May 11 20:48screenpipe_sync.sh-rwxrwxrwx+ 1 Admin admin20K May 10 13:06screenpipe_sync_updated.shAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe$ cp archive.dbarchive.db.bak-pre-installidAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes ./screenpipe_fts_migrate.sh archive.dbScreenpipe FTS migrationDB:archive.dbSize: 13G• ×4-zsh• 285screenpipe"O 886ssh100% <78•Tue 12 May 15:48:1518187-zsh• *8+• Creating install registry_installs table• Om01s• Adding install_id to base tablesvideo_chunksalready presentError: stepping, UNIQUEconstraintfailed: video_chunks.install_id, video_chunks.id (19)Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT * FROM_installs;"Adm1neDXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT install_id, COUNT(*) FROM frames GROUP BY install_id;"Error: in prepare, no such column: install_idSELECT install_id,COUNT(*) FROM frames GROUP BY install_id;^_-- error hereAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes |...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26617
|
1103
|
13
|
2026-05-12T12:48:15.714365+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590095714_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
2605773330225994555
|
3492670867553552277
|
app_switch
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26619
|
1103
|
14
|
2026-05-12T12:48:18.267037+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590098267_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
Problems (⇧⌘M)
PROBLEMS
Output (⇧⌘U)
OUTPUT
Debug Console (⇧⌘Y)
DEBUG CONSOLE
Terminal (⌃`)
TERMINAL
Ports - 1 forwarded port
PORTS
1
Remote - SSH - Output
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follo...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"Problems (⇧⌘M)","depth":22,"bounds":{"left":0.11868351,"top":0.7278532,"width":0.027925532,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"PROBLEMS","depth":24,"bounds":{"left":0.12267287,"top":0.7366321,"width":0.019946808,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Output (⇧⌘U)","depth":22,"bounds":{"left":0.1462766,"top":0.7278532,"width":0.023603724,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"OUTPUT","depth":24,"bounds":{"left":0.15026596,"top":0.7366321,"width":0.015625,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Debug Console (⇧⌘Y)","depth":22,"bounds":{"left":0.16954787,"top":0.7278532,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"DEBUG CONSOLE","depth":24,"bounds":{"left":0.17353724,"top":0.7366321,"width":0.031914894,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Terminal (⌃`)","depth":22,"bounds":{"left":0.20910904,"top":0.7278532,"width":0.026595745,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"TERMINAL","depth":24,"bounds":{"left":0.2130984,"top":0.7366321,"width":0.01861702,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Ports - 1 forwarded port","depth":22,"bounds":{"left":0.2357048,"top":0.7278532,"width":0.026263298,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"PORTS","depth":24,"bounds":{"left":0.23969415,"top":0.7366321,"width":0.012300532,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":25,"bounds":{"left":0.2549867,"top":0.73743016,"width":0.0019946808,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXTextArea","text":"Remote - SSH - Output","depth":27,"bounds":{"left":0.12267287,"top":0.9680766,"width":0.87200797,"height":0.014365523},"on_screen":true,"role_description":"editor","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"}]...
|
2511439698341851522
|
3492670730383099797
|
visual_change
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
Problems (⇧⌘M)
PROBLEMS
Output (⇧⌘U)
OUTPUT
Debug Console (⇧⌘Y)
DEBUG CONSOLE
Terminal (⌃`)
TERMINAL
Ports - 1 forwarded port
PORTS
1
Remote - SSH - Output
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follo...
|
26617
|
NULL
|
NULL
|
NULL
|
|
26621
|
1103
|
15
|
2026-05-12T12:48:19.436824+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590099436_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
2605773330225994555
|
3492670867553552277
|
click
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26620
|
1102
|
10
|
2026-05-12T12:48:19.436920+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590099436_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
Problems (⇧⌘M)
PROBLEMS
Output (⇧⌘U)
OUTPUT
Debug Console (⇧⌘Y)
DEBUG CONSOLE
Terminal (⌃`)
TERMINAL
Ports - 1 forwarded port
PORTS
1
Remote - SSH - Output...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"Problems (⇧⌘M)","depth":22,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"PROBLEMS","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Output (⇧⌘U)","depth":22,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"OUTPUT","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Debug Console (⇧⌘Y)","depth":22,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"DEBUG CONSOLE","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Terminal (⌃`)","depth":22,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"TERMINAL","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Ports - 1 forwarded port","depth":22,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"PORTS","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXTextArea","text":"Remote - SSH - Output","depth":27,"on_screen":true,"role_description":"editor"}]...
|
-8014398207710573142
|
3474656469312505749
|
click
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
Problems (⇧⌘M)
PROBLEMS
Output (⇧⌘U)
OUTPUT
Debug Console (⇧⌘Y)
DEBUG CONSOLE
Terminal (⌃`)
TERMINAL
Ports - 1 forwarded port
PORTS
1
Remote - SSH - Output...
|
26618
|
NULL
|
NULL
|
NULL
|
|
26622
|
1103
|
16
|
2026-05-12T12:48:21.290744+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590101290_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.10853951,"width":0.0066489363,"height":0.0007980846},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"bounds":{"left":0.5674867,"top":0.10853951,"width":0.09275266,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5237734055032025378
|
3492635546011010965
|
visual_change
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
26621
|
NULL
|
NULL
|
NULL
|
|
26623
|
1102
|
11
|
2026-05-12T12:48:49.807353+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590129807_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Exit code 1\npermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?filters=%7B%22name%22%3A%7B%22screenpipe%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I don't have Docker socket access, so you'll need to run these yourself. Here are your options:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option A — via Docker (if container is already running):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List available pipes\ndocker exec -it screenpipe-app python cli.py pipe --list\n\n# Run a specific pipe\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option B — rebuild first (since we added new files), then run:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option C — via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(if container is up on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST http://localhost:8766/api/pipes/day-recap/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"day-recap","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"or","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"standup-update","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes are the best ones to test first since they use all data sources. Which option works for you?","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"how ot run for specifiday","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Docker exec:","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-25\n# or shortcuts:\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date yesterday\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date today","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"API:","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"curl -X POST \"http://localhost:8766/api/pipes/day-recap/run?d=2026-04-25\"","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CaSoR75WgV8fTcHTYJMDY'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"The container started before you updated the","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":", so it's using the old placeholder key. Restart it to pick up the new one:","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\nsudo docker compose restart screenpipe-app","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Then try again:","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CaSoaWfbMTbPTbw5PpBu1'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":".env","depth":23,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":".env","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"key is there now but Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits.'}, 'request_id': 'req_011CaSonLU15vYJpDQyCCHmb'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"The key works — it authenticated successfully. The error is just that your Anthropic account has no credits. Go to","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"console.anthropic.com → Plans & Billing","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"and add some credits (a few dollars is enough for testing).","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Once topped up, rerun the same command and it should work.","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXTextArea","text":"⌘ Esc to focus or unfocus Claude","depth":24,"on_screen":true,"value":"⌘ Esc to focus or unfocus Claude","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"⌘ Esc to focus or unfocus Claude","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Add","depth":24,"bounds":{"left":0.83194447,"top":0.0,"width":0.018055556,"height":0.028888889},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Show command menu (/)","depth":23,"bounds":{"left":0.8513889,"top":0.0,"width":0.018055556,"height":0.028888889},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"screenpipe_sync.sh","depth":23,"bounds":{"left":0.8784722,"top":0.0,"width":0.09652778,"height":0.028888889},"on_screen":true,"help_text":"Showing Claude your current file selection (screenpipe_sync.sh)","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":24,"bounds":{"left":0.89652777,"top":0.0,"width":0.072916664,"height":0.014444444},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Ask before edits","depth":24,"on_screen":true,"help_text":"Claude will ask for approval before making each edit. Click to change, or press Shift+Tab to cycle.","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Ask before edits","depth":25,"on_screen":true,"role_description":"text"}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26624
|
1103
|
17
|
2026-05-12T12:48:51.657664+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590131657_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.10853951,"width":0.0066489363,"height":0.0007980846},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"bounds":{"left":0.5674867,"top":0.10853951,"width":0.09275266,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Exit code 1\npermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?filters=%7B%22name%22%3A%7B%22screenpipe%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I don't have Docker socket access, so you'll need to run these yourself. Here are your options:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option A — via Docker (if container is already running):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List available pipes\ndocker exec -it screenpipe-app python cli.py pipe --list\n\n# Run a specific pipe\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option B — rebuild first (since we added new files), then run:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option C — via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(if container is up on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST http://localhost:8766/api/pipes/day-recap/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The","depth":23,"bounds":{"left":0.57513297,"top":0.11412609,"width":0.008976064,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"day-recap","depth":24,"bounds":{"left":0.58543885,"top":0.11572227,"width":0.021276595,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"or","depth":23,"bounds":{"left":0.60771275,"top":0.11412609,"width":0.0066489363,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"standup-update","depth":24,"bounds":{"left":0.6156915,"top":0.11572227,"width":0.032912236,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes are the best ones to test first since they use all data sources. Which option works for you?","depth":23,"bounds":{"left":0.64960104,"top":0.11412609,"width":0.19448139,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.14046289,"width":0.0066489363,"height":0.015961692},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"how ot run for specifiday","depth":25,"bounds":{"left":0.5674867,"top":0.15403032,"width":0.049867023,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"bounds":{"left":0.57513297,"top":0.1915403,"width":0.023936171,"height":0.015961692},"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"bounds":{"left":0.57513297,"top":0.19313647,"width":0.017287234,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Docker exec:","depth":24,"bounds":{"left":0.57513297,"top":0.22186752,"width":0.027925532,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.24501197,"width":0.007978723,"height":0.019952115},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-25\n# or shortcuts:\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date yesterday\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date today","depth":25,"bounds":{"left":0.5777925,"top":0.25059855,"width":0.18051861,"height":0.058260176},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"API:","depth":24,"bounds":{"left":0.57513297,"top":0.32482043,"width":0.008976064,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.34876296,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"curl -X POST \"http://localhost:8766/api/pipes/day-recap/run?d=2026-04-25\"","depth":25,"bounds":{"left":0.5777925,"top":0.35434955,"width":0.17121011,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.38946527,"width":0.0066489363,"height":0.016759777},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26625
|
1102
|
12
|
2026-05-12T12:49:20.115690+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590160115_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"}]...
|
-553907988430076668
|
3472369347685746581
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN...
|
26623
|
NULL
|
NULL
|
NULL
|
|
26626
|
1103
|
18
|
2026-05-12T12:49:21.994112+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590161994_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.10853951,"width":0.0066489363,"height":0.0007980846},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"bounds":{"left":0.5674867,"top":0.10853951,"width":0.09275266,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Exit code 1\npermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?filters=%7B%22name%22%3A%7B%22screenpipe%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I don't have Docker socket access, so you'll need to run these yourself. Here are your options:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option A — via Docker (if container is already running):","depth":24,"on_screen":false,"role_description":"text"}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
26624
|
NULL
|
NULL
|
NULL
|
|
26628
|
1103
|
19
|
2026-05-12T12:49:36.271849+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590176271_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5685266402682420683
|
-8926130836387591936
|
app_switch
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Proleteyselection© MomentController.ph© NudgeController.php® NumberAllocatorCon© OrganizationLicense:© OrganizationMembero ureanizauonkelenule© OrganizationRolesCoc) Organizationsynccol© PartnerController.phy) Phonenumbercontrc© PlaybackController.p© PlaylistController.php® ScimController.phpSidekickController.pt© SoftphoneController.c) Ssocontroller.oho© SubscriptionControll 109C) TeamAiAutomatione@ TeamController.ohn(C) TranscriotionControll© TranslationController 115© UserController.php© VocabularyControllerm AuthiCustomerApiInternal~ D Kiosk>D Teams©ActivityController.ph/© AutomatedReportsC, 124© DashboardController© ImpersonationContrc 126© MediaPipelineControOrganizationsContro 128© PartnersController.pt© ProfileController.phpc) Searchcontroller.ohr> D Settings→ Telechonv~ D Webhook• M Hubsoot> D IntegrationAppSubsc 136(C) ActivitvProviderCont© ActivityTranscriptionC) BaseController.oho© CalendarController.pC) RenortController nhoSoftphoneWebhookCC. AbstractController nhn• TrackAutomatedReportGeneratedEvent.phpPlaybackController.phpAutomatedkeponkesuitonpclass keportuoncroller excenas Adstractlontrollerif (Sreport->getReport() ->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) €send the primary revort$this->dispatcher->dispatch(new SendReportJob($reportUuid));// send the podcast report if it set and generatedif (SreportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) €$this-›dispatcher-›dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));// Track Datadog metrics for automated reportsSautomatedReport = $report->getReport();scnis->caLLbackservice->pushlovaradoe caucomareakeport, sreporcif (SreportPodcast) {schis->callbackservice->pushlobaradoqsautomatedkeport, sreportroacast^Sth1s→>L000gPSSthis->event} catch (ModelNc+Sthis->loggePhpStorm=> $reportUuid,erron' => sexcention->detMessadeOl.return response() ->json(['status' →> 'error', 'message'=> 'Report not found'], status: 404);catchThrowable Sexcention) ^$this->logger->error(self::LOG_PREFIX ' Failed to update report status', ['vuid' = SreportUvid,'error' => $exception-›getMessage(),return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);return response()->json(['status' => 'ok']);$I"ketro - Platorm • In ih 11mA console (EU]A console [STAGING] XA SF [jiminny@localhost]Playgroundf ho_local Uiminny@localnost# console [PKol)# crm contiquration1d, crm provider 1d, transcription 1d, status# and crm provider 1d IS NUT NULLand provider = 'uploader' and actual start time Is Not NULLORDER OV 10 desc:select * trom activitles where 1d = 54747785:# 00U040000000207MACselect p.id, p.activity_type, pc.id, pc.nameFROM playbooks pjoin playbook_categories pc 1<->1.n: on p.id = pc.playbook_idwhere p.team id = 1 and p.activity tvoe = 'event'.SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';SELECT * FROM crm_field_values WHERE crm_field_id = 4;select * from crm_layouts cl join playbook_layouts pl 1<->1.n: on cl.id = pl.layout_idwhere crm_configuration_id = 1 and pl.playbook_id = 175;100% 5&• Tue 12 May 15:49:35Sajiminny_mars| 04 A1 X13 ^575577578vselect * from automated report results where report id IN (18. 33):select * from activity_searches where id = 10932;select * from activity search filterswhere activity search 1d = 109521select * from automated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated nenont results where 1d iiN 810-select * from users where id IN (10633, 13987, 11985);select * from usens whene aroun id TN (37100•SELECT * EROM automated nenonts WHERE uuid to bin(118a06a75-afd2-476f-aadc-14d4057hdda20) = uuidsSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uvid;select * from automated_report_results where media_type = 'pdf' and status = 2;SELECT * FROM automated_report_results WHERE Uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uvid;f2 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26627
|
1102
|
13
|
2026-05-12T12:49:36.285371+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590176285_m1.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
8956692732016058251
|
-8204340751569409078
|
app_switch
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
SlackFileEditViewGoHistoryWindowHelpRetro - Platform • in 1h 11 mAsshDOCKER• 81DEV (-zsh)О ₴2APP (-zsh)• *[EMAIL]@Lukas-Kovaliks-MacBook-Pro-Jiminny~/.screenpipe/data $ cd ..[EMAIL] $ nasAdm1n@DXP4800PLUS-B5F8: ~$cd/volumel/screenpipe/Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes 1ltotal26Gdrwxrwxrwx+1rootroot410 May1215:15drwxr-xr-xrootroot450 Apr2519:39drwxrwxrwx+1Adminadmin202 Apr2620:10drwxrwxrwx+1Adminadmin298 May1013:46drwxrwxrwx+Adminadmin144 May09:41drwxrwxrwx+1Admin admin70 May1013:47drwxrwxrwx+1Adminadmin164 Apr1116:51drwxrwxrwx+1rootroot5.1KMay1120:55-rwxrwxrwx+1rootroot31Apr1817:42app_settings.json1Adminadmin13G May1120:55archive.db-rwxrwxrwx+1Adminadmin11G May10-rwxrwxrwx+Admin admin 3.5G May1112:31archive.db-bak20:15db.sqlite-rwxrwxrwx+1Admin admin32K May1205:48db.sqlite-shm-rwxrwxrwx+ 1Admin admin0 Apr 26 17:17db.sqlite-wal1Admin admin11K May 12 09:09.DS_Store-rwxrwxrwx+ 1 Admin admin219 Apr24 19:33•gitignore-rwxrwxrWx+1 Admin admin0 Apr1317:21screenpipe.db-rwxrwxrwx+1 Admin admin 8.4K May12 15:15screenpipe_fts_migrate.sh-rwxrwxrwx+ 1 Admin admin32K May 11 20:48screenpipe_sync.sh-rwxrwxrwx+ 1 Admin admin20K May 10 13:06screenpipe_sync_updated.shAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe$ cp archive.dbarchive.db.bak-pre-installidAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes ./screenpipe_fts_migrate.sh archive.dbScreenpipe FTS migrationDB:archive.dbSize: 13G• ×4-zsh• 285screenpipe"O 886ssh100% <78•Tue 12 May 15:49:36T8187-zsh• *8+• Creating install registry_installs table• Om01s• Adding install_id to base tablesvideo_chunksalready presentError: stepping, UNIQUEconstraintfailed: video_chunks.install_id, video_chunks.id (19)Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT * FROM_installs;"Adm1neDXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT install_id, COUNT(*) FROM frames GROUP BY install_id;"Error: in prepare, no such column: install_idSELECT install_id,COUNT(*) FROM frames GROUP BY install_id;^_-- error hereAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes |...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26629
|
1103
|
20
|
2026-05-12T12:49:37.833010+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590177833_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.97706115,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.98836434,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.55485374,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.56349736,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5744681,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5831117,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.59175533,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.60272604,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.6136968,"top":0.074221864,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.6402925,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6512633,"top":0.074221864,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"bounds":{"left":0.9481383,"top":0.074221864,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9431516,"top":0.09896249,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.953125,"top":0.09896249,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"bounds":{"left":0.9624335,"top":0.09896249,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9737367,"top":0.09736632,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98105055,"top":0.09736632,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
26628
|
NULL
|
NULL
|
NULL
|
|
26630
|
1102
|
14
|
2026-05-12T12:50:07.070337+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590207070_m1.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
26627
|
NULL
|
NULL
|
NULL
|
|
26631
|
1103
|
21
|
2026-05-12T12:50:08.192714+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590208192_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.97706115,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.98836434,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.55485374,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.56349736,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5744681,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5831117,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.59175533,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.60272604,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.6136968,"top":0.074221864,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.6402925,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6512633,"top":0.074221864,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"bounds":{"left":0.9481383,"top":0.074221864,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9431516,"top":0.09896249,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.953125,"top":0.09896249,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"bounds":{"left":0.9624335,"top":0.09896249,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9737367,"top":0.09736632,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98105055,"top":0.09736632,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26632
|
1102
|
15
|
2026-05-12T12:50:15.056215+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590215056_m1.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
-4587688648335905065
|
-3300625451126785884
|
app_switch
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26633
|
1103
|
22
|
2026-05-12T12:50:15.089891+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590215089_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"bounds":{"left":0.0028257978,"top":0.057063047,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"bounds":{"left":0.0028257978,"top":0.08060654,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"bounds":{"left":0.015957447,"top":0.09217877,"width":0.40492022,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0028257978,"top":0.11332801,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.015957447,"top":0.12490024,"width":0.04138963,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.12051077,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.14604948,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.15762171,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"bounds":{"left":0.0,"top":0.17877094,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.19034317,"width":0.16140293,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.21149242,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.22306465,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"bounds":{"left":0.0,"top":0.2442139,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.25578612,"width":0.1200133,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.27693537,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.28850758,"width":0.1931516,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"bounds":{"left":0.0,"top":0.30965683,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.32122904,"width":0.07646277,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3423783,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.35395053,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"bounds":{"left":0.0,"top":0.37509975,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.386672,"width":0.09524601,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"bounds":{"left":0.0,"top":0.40782124,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.41939345,"width":0.053025264,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"bounds":{"left":0.0,"top":0.4405427,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"bounds":{"left":0.013297873,"top":0.4521149,"width":0.030418882,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.0028257978,"top":0.47486034,"width":0.07413564,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0028257978,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"bounds":{"left":0.013796543,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.024933511,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"bounds":{"left":0.036070477,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"bounds":{"left":0.04720745,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"bounds":{"left":0.07962101,"top":0.055067837,"width":0.021609042,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"bounds":{"left":0.079288565,"top":0.054269753,"width":0.0013297872,"height":0.0015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"bounds":{"left":0.079953454,"top":0.055067837,"width":0.01662234,"height":0.051476456},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"bounds":{"left":0.1015625,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"bounds":{"left":0.11818484,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"bounds":{"left":0.13480718,"top":0.0622506,"width":0.17952128,"height":0.023942538},"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"bounds":{"left":0.30103058,"top":0.06464485,"width":0.009973404,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"bounds":{"left":0.27942154,"top":0.06743815,"width":0.023271276,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"bounds":{"left":0.8128325,"top":0.055067837,"width":0.015957447,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"bounds":{"left":0.8287899,"top":0.058260176,"width":0.01662234,"height":0.031923383},"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"bounds":{"left":0.84541225,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-7150255068448850857
|
-2868279886614005600
|
app_switch
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26634
|
1103
|
23
|
2026-05-12T12:50:17.124637+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590217124_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"bounds":{"left":0.0028257978,"top":0.057063047,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"bounds":{"left":0.0028257978,"top":0.08060654,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"bounds":{"left":0.015957447,"top":0.09217877,"width":0.40492022,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0028257978,"top":0.11332801,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.015957447,"top":0.12490024,"width":0.04138963,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.12051077,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.14604948,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.15762171,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"bounds":{"left":0.0,"top":0.17877094,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.19034317,"width":0.16140293,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.21149242,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.22306465,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"bounds":{"left":0.0,"top":0.2442139,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.25578612,"width":0.1200133,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.27693537,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.28850758,"width":0.1931516,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"bounds":{"left":0.0,"top":0.30965683,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.32122904,"width":0.07646277,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3423783,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.35395053,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"bounds":{"left":0.0,"top":0.37509975,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.386672,"width":0.09524601,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"bounds":{"left":0.0,"top":0.40782124,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.41939345,"width":0.053025264,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"bounds":{"left":0.0,"top":0.4405427,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"bounds":{"left":0.013297873,"top":0.4521149,"width":0.030418882,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.0028257978,"top":0.47486034,"width":0.07413564,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0028257978,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"bounds":{"left":0.013796543,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.024933511,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"bounds":{"left":0.036070477,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"bounds":{"left":0.04720745,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"bounds":{"left":0.07962101,"top":0.055067837,"width":0.021609042,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"bounds":{"left":0.079288565,"top":0.054269753,"width":0.0013297872,"height":0.0015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"bounds":{"left":0.079953454,"top":0.055067837,"width":0.01662234,"height":0.051476456},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"bounds":{"left":0.1015625,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"bounds":{"left":0.11818484,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"bounds":{"left":0.13480718,"top":0.0622506,"width":0.17952128,"height":0.023942538},"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"bounds":{"left":0.30103058,"top":0.06464485,"width":0.009973404,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"bounds":{"left":0.27942154,"top":0.06743815,"width":0.023271276,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"bounds":{"left":0.8128325,"top":0.055067837,"width":0.015957447,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"bounds":{"left":0.8287899,"top":0.058260176,"width":0.01662234,"height":0.031923383},"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"bounds":{"left":0.84541225,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"bounds":{"left":0.86203456,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"bounds":{"left":0.8786569,"top":0.055067837,"width":0.053690158,"height":0.03830806},"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"bounds":{"left":0.8843085,"top":0.06823623,"width":0.03706782,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"bounds":{"left":0.93234706,"top":0.055067837,"width":0.067652926,"height":0.03830806},"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"bounds":{"left":0.9353391,"top":0.057063047,"width":0.05435505,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"bounds":{"left":0.98204786,"top":0.075418994,"width":0.010638298,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"bounds":{"left":0.08228058,"top":0.09577015,"width":0.020279255,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"bounds":{"left":0.09291888,"top":0.1009577,"width":0.006981383,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"bounds":{"left":0.10255984,"top":0.09577015,"width":0.057513297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"bounds":{"left":0.11319814,"top":0.1009577,"width":0.044215426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"bounds":{"left":0.16007313,"top":0.09577015,"width":0.017952127,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"bounds":{"left":0.17071144,"top":0.1009577,"width":0.004654255,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"bounds":{"left":0.17802526,"top":0.09577015,"width":0.03507314,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"bounds":{"left":0.18866356,"top":0.1009577,"width":0.021775266,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"bounds":{"left":0.2130984,"top":0.09577015,"width":0.03523936,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"bounds":{"left":0.2237367,"top":0.1009577,"width":0.021941489,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"bounds":{"left":0.24833776,"top":0.09577015,"width":0.033909574,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"bounds":{"left":0.25897607,"top":0.1009577,"width":0.020611702,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"bounds":{"left":0.28224733,"top":0.09577015,"width":0.041888297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"bounds":{"left":0.29288563,"top":0.1009577,"width":0.028590426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"bounds":{"left":0.32413563,"top":0.09577015,"width":0.0631649,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"bounds":{"left":0.33477393,"top":0.1009577,"width":0.051861703,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"bounds":{"left":0.38730052,"top":0.09577015,"width":0.033410903,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"bounds":{"left":0.39793882,"top":0.1009577,"width":0.020113032,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"bounds":{"left":0.42071143,"top":0.09577015,"width":0.031416222,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"bounds":{"left":0.43134972,"top":0.1009577,"width":0.018118352,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"bounds":{"left":0.08494016,"top":0.12410215,"width":0.009973404,"height":0.023942538},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"bounds":{"left":0.098902926,"top":0.1272945,"width":0.026928192,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"bounds":{"left":0.099567816,"top":0.1292897,"width":0.025598405,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"bounds":{"left":0.13646941,"top":0.12809257,"width":0.028590426,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"bounds":{"left":0.13646941,"top":0.1292897,"width":0.028590426,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Query definition","depth":26,"bounds":{"left":0.09424867,"top":0.16959298,"width":0.05036569,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXButton","text":"Query definition","depth":28,"bounds":{"left":0.085605055,"top":0.16959298,"width":0.05900931,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Info : Query definition","depth":27,"bounds":{"left":0.14727394,"top":0.17557861,"width":0.0076462766,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log Analytics","depth":29,"bounds":{"left":0.17253989,"top":0.17517957,"width":0.02443484,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"a unified observability platform for a smoother experience, now in preview mode. Click","depth":28,"bounds":{"left":0.19963431,"top":0.1735834,"width":0.1853391,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"here","depth":28,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"here","depth":29,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"to try it out!","depth":28,"bounds":{"left":0.39444813,"top":0.1735834,"width":0.026595745,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"5m (5 Minutes)","depth":27,"bounds":{"left":0.7155917,"top":0.1707901,"width":0.012134309,"height":0.015961692},"on_screen":true,"help_text":"5 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"30m (30 Minutes)","depth":27,"bounds":{"left":0.73537236,"top":0.1707901,"width":0.014960106,"height":0.015961692},"on_screen":true,"help_text":"30 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"1h (1 Hour)","depth":27,"bounds":{"left":0.75797874,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"1 Hour","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"3h (3 Hours)","depth":27,"bounds":{"left":0.77642953,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"3 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"12h (12 Hours)","depth":27,"bounds":{"left":0.7947141,"top":0.1707901,"width":0.013630319,"height":0.015961692},"on_screen":true,"help_text":"12 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Custom","depth":27,"bounds":{"left":0.8159907,"top":0.1707901,"width":0.024268618,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Custom","depth":29,"bounds":{"left":0.8159907,"top":0.17158818,"width":0.016289894,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"Compare (Off)","depth":26,"bounds":{"left":0.84674203,"top":0.16679968,"width":0.046875,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Compare","depth":27,"bounds":{"left":0.8540558,"top":0.17238627,"width":0.019946808,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.87400264,"top":0.17238627,"width":0.0028257978,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Off","depth":27,"bounds":{"left":0.87682843,"top":0.17238627,"width":0.0078125,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.88464093,"top":0.17238627,"width":0.0016622341,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Time zone UTC timezone","depth":26,"bounds":{"left":0.8959442,"top":0.16679968,"width":0.046043884,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"UTC timezone","depth":28,"bounds":{"left":0.90026593,"top":0.17238627,"width":0.029421542,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Start tailing with selected log group (opens in a new tab)","depth":26,"bounds":{"left":0.9459774,"top":0.16679968,"width":0.048038565,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Start tailing","depth":27,"bounds":{"left":0.95994014,"top":0.17238627,"width":0.026761968,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query scope","depth":28,"bounds":{"left":0.085605055,"top":0.21827614,"width":0.027094414,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Query scope All log groups","depth":27,"bounds":{"left":0.085605055,"top":0.24102154,"width":0.06648936,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"All log groups","depth":29,"bounds":{"left":0.08992686,"top":0.24700718,"width":0.02925532,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"All log groups","depth":26,"bounds":{"left":0.15807846,"top":0.24102154,"width":0.73055184,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"search text field","subrole":"AXSearchField","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log class","depth":28,"bounds":{"left":0.8912899,"top":0.21827614,"width":0.019780586,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Log class STANDARD","depth":27,"bounds":{"left":0.8912899,"top":0.24102154,"width":0.04305186,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"STANDARD","depth":29,"bounds":{"left":0.8956117,"top":0.24700718,"width":0.023603724,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Account(s)","depth":28,"bounds":{"left":0.93700135,"top":0.21827614,"width":0.022938829,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Account(s) Change Account(s)","depth":27,"bounds":{"left":0.93700135,"top":0.24102154,"width":0.05319149,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Change Account(s)","depth":29,"bounds":{"left":0.94132316,"top":0.24700718,"width":0.038065158,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Remove All accounts","depth":29,"bounds":{"left":0.96825135,"top":0.27773345,"width":0.008643617,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Undo","depth":28,"bounds":{"left":0.94431514,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Redo","depth":28,"bounds":{"left":0.9562833,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXMenuButton","text":"Logs Insights QL","depth":29,"bounds":{"left":0.09125665,"top":0.4696728,"width":0.057679523,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Query generator","depth":26,"bounds":{"left":0.15159574,"top":0.4660814,"width":0.05236037,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Query generator","depth":28,"bounds":{"left":0.16356383,"top":0.4744613,"width":0.036402926,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Fields","depth":28,"bounds":{"left":0.21459441,"top":0.4744613,"width":0.012799202,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Saved and sample queries","depth":28,"bounds":{"left":0.24202128,"top":0.4744613,"width":0.05651596,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query commands","depth":28,"bounds":{"left":0.3131649,"top":0.4744613,"width":0.03856383,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Run query","depth":27,"bounds":{"left":0.085605055,"top":0.509178,"width":0.03723404,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Cancel","depth":27,"bounds":{"left":0.12549867,"top":0.509178,"width":0.02925532,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Save","depth":27,"bounds":{"left":0.15741356,"top":0.509178,"width":0.024933511,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"History","depth":27,"bounds":{"left":0.24634309,"top":0.509178,"width":0.030751329,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Completed. Query executed for","depth":28,"bounds":{"left":0.09225399,"top":0.5422985,"width":0.06615692,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"78 log groups.","depth":28,"bounds":{"left":0.15957446,"top":0.5422985,"width":0.03025266,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"View log groups used in query","depth":28,"bounds":{"left":0.19099069,"top":0.5422985,"width":0.005319149,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Logs (5)","depth":25,"bounds":{"left":0.081615694,"top":0.57781327,"width":0.028091755,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"Logs","depth":27,"bounds":{"left":0.085605055,"top":0.58739024,"width":0.011469414,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.09857048,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"5","depth":27,"bounds":{"left":0.100398935,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.103557184,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Patterns (1)","depth":25,"bounds":{"left":0.115359046,"top":0.57781327,"width":0.03756649,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Patterns","depth":27,"bounds":{"left":0.11934841,"top":0.58739024,"width":0.021110373,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.14045878,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"1","depth":27,"bounds":{"left":0.14361702,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.14677526,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Visualization","depth":25,"bounds":{"left":0.15857713,"top":0.57781327,"width":0.04089096,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Visualization","depth":27,"bounds":{"left":0.16256648,"top":0.58739024,"width":0.032579787,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Logs (5)","depth":26,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Logs (5)","depth":27,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Summarize results","depth":26,"bounds":{"left":0.6627327,"top":0.61851555,"width":0.06216755,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Summarize results","depth":27,"bounds":{"left":0.67669547,"top":0.62450117,"width":0.04089096,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Investigate","depth":28,"bounds":{"left":0.72755986,"top":0.61851555,"width":0.05285904,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Investigate","depth":29,"bounds":{"left":0.7421875,"top":0.62450117,"width":0.024268618,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Share results","depth":26,"bounds":{"left":0.78307843,"top":0.61851555,"width":0.050033245,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Share results","depth":27,"bounds":{"left":0.79704124,"top":0.62450117,"width":0.028756648,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Export results","depth":28,"bounds":{"left":0.83577126,"top":0.61851555,"width":0.052027926,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Export results","depth":29,"bounds":{"left":0.8430851,"top":0.62450117,"width":0.030751329,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Add to dashboard","depth":26,"bounds":{"left":0.89045876,"top":0.61851555,"width":0.054022606,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Showing 5 of 5 records matched","depth":29,"bounds":{"left":0.4865359,"top":0.6584198,"width":0.075465426,"height":0.016759777},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)","depth":29,"bounds":{"left":0.4381649,"top":0.6763767,"width":0.17204122,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Hide histogram","depth":26,"bounds":{"left":0.9665891,"top":0.65682364,"width":0.031083776,"height":0.03431764},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Hide histogram","depth":27,"bounds":{"left":0.9665891,"top":0.65881884,"width":0.027759308,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"Filter table results","depth":25,"bounds":{"left":0.08261303,"top":0.7765363,"width":0.21542554,"height":0.025538707},"on_screen":true,"help_text":"","placeholder":"Filter table results (case insensitive)...","role_description":"search text field","subrole":"AXSearchField","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Completed. Query executed for 78 log groups.","depth":19,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudShell","depth":12,"bounds":{"left":0.08494016,"top":0.9784517,"width":0.02642952,"height":0.015961692},"on_screen":true,"help_text":"Open CloudShell","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudShell","depth":14,"bounds":{"left":0.091921546,"top":0.98044693,"width":0.019448139,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Feedback","depth":11,"bounds":{"left":0.11968085,"top":0.980846,"width":0.017121011,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Feedback","depth":13,"bounds":{"left":0.11968085,"top":0.98044693,"width":0.017121011,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"©","depth":12,"bounds":{"left":0.8159907,"top":0.98044693,"width":0.004155585,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026","depth":12,"bounds":{"left":0.82014626,"top":0.98044693,"width":0.00930851,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":",","depth":12,"bounds":{"left":0.8294548,"top":0.98044693,"width":0.0019946808,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Amazon Web Services, Inc.","depth":12,"bounds":{"left":0.83144945,"top":0.98044693,"width":0.048038565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"or its affiliates.","depth":12,"bounds":{"left":0.88048536,"top":0.98044693,"width":0.026595745,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Privacy","depth":13,"bounds":{"left":0.91705453,"top":0.9796488,"width":0.014295213,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Privacy","depth":14,"bounds":{"left":0.9177194,"top":0.98044693,"width":0.012965426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Terms","depth":13,"bounds":{"left":0.9396609,"top":0.9796488,"width":0.012300532,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Terms","depth":14,"bounds":{"left":0.9403258,"top":0.98044693,"width":0.010970744,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Cookie preferences","depth":13,"bounds":{"left":0.9602726,"top":0.980846,"width":0.034408245,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
6780981576055161636
|
-272112794895568460
|
visual_change
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
26633
|
NULL
|
NULL
|
NULL
|
|
26635
|
1103
|
24
|
2026-05-12T12:50:20.194973+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590220194_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.10853951,"width":0.0066489363,"height":0.0007980846},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"bounds":{"left":0.5674867,"top":0.10853951,"width":0.09275266,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Exit code 1\npermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?filters=%7B%22name%22%3A%7B%22screenpipe%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I don't have Docker socket access, so you'll need to run these yourself. Here are your options:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option A — via Docker (if container is already running):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List available pipes\ndocker exec -it screenpipe-app python cli.py pipe --list\n\n# Run a specific pipe\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option B — rebuild first (since we added new files), then run:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option C — via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(if container is up on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST http://localhost:8766/api/pipes/day-recap/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The","depth":23,"bounds":{"left":0.57513297,"top":0.11412609,"width":0.008976064,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"day-recap","depth":24,"bounds":{"left":0.58543885,"top":0.11572227,"width":0.021276595,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"or","depth":23,"bounds":{"left":0.60771275,"top":0.11412609,"width":0.0066489363,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"standup-update","depth":24,"bounds":{"left":0.6156915,"top":0.11572227,"width":0.032912236,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes are the best ones to test first since they use all data sources. Which option works for you?","depth":23,"bounds":{"left":0.64960104,"top":0.11412609,"width":0.19448139,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.14046289,"width":0.0066489363,"height":0.015961692},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"how ot run for specifiday","depth":25,"bounds":{"left":0.5674867,"top":0.15403032,"width":0.049867023,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"bounds":{"left":0.57513297,"top":0.1915403,"width":0.023936171,"height":0.015961692},"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"bounds":{"left":0.57513297,"top":0.19313647,"width":0.017287234,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Docker exec:","depth":24,"bounds":{"left":0.57513297,"top":0.22186752,"width":0.027925532,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.24501197,"width":0.007978723,"height":0.019952115},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-25\n# or shortcuts:\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date yesterday\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date today","depth":25,"bounds":{"left":0.5777925,"top":0.25059855,"width":0.18051861,"height":0.058260176},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"API:","depth":24,"bounds":{"left":0.57513297,"top":0.32482043,"width":0.008976064,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.34876296,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"curl -X POST \"http://localhost:8766/api/pipes/day-recap/run?d=2026-04-25\"","depth":25,"bounds":{"left":0.5777925,"top":0.35434955,"width":0.17121011,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.38946527,"width":0.0066489363,"height":0.016759777},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CaSoR75WgV8fTcHTYJMDY'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"bounds":{"left":0.5674867,"top":0.40303272,"width":0.3693484,"height":0.04708699},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"bounds":{"left":0.57513297,"top":0.47406226,"width":0.023936171,"height":0.015961692},"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5237734055032025378
|
3492635546011010965
|
visual_change
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26636
|
1103
|
25
|
2026-05-12T12:50:26.286461+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590226286_m2.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.09541223,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8238032,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"bounds":{"left":0.8390958,"top":0.019952115,"width":0.076130316,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.91522604,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"bounds":{"left":0.9265292,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9378325,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96575797,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.97706115,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.98836434,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.55485374,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.56349736,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.5744681,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.5831117,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.59175533,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.60272604,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.6136968,"top":0.074221864,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.6402925,"top":0.074221864,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.6512633,"top":0.074221864,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"bounds":{"left":0.9481383,"top":0.074221864,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"bounds":{"left":0.9431516,"top":0.09896249,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.953125,"top":0.09896249,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"bounds":{"left":0.9624335,"top":0.09896249,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.9737367,"top":0.09736632,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.98105055,"top":0.09736632,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26637
|
1102
|
16
|
2026-05-12T12:50:27.491035+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590227491_m1.jpg...
|
PhpStorm
|
faVsco.js – ReportController.php
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JY-20725-handle-HS-search-rate-limit, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20725-handle-HS-search-rate-limit","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HandleHubspotRateLimitTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'HandleHubspotRateLimitTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Controllers\\Webhook;\n\nuse Carbon\\Carbon;\nuse Illuminate\\Contracts\\Bus\\Dispatcher as BusDispatcher;\nuse Illuminate\\Contracts\\Events\\Dispatcher as EventDispatcher;\nuse Illuminate\\Http\\JsonResponse;\nuse Illuminate\\Http\\Request;\nuse Jiminny\\Events\\AutomatedReports\\AutomatedReportGenerated;\nuse Jiminny\\Exceptions\\ModelNotFoundException;\nuse Jiminny\\Http\\Controllers\\AbstractController;\nuse Jiminny\\Jobs\\AutomatedReports\\SendReportJob;\nuse Jiminny\\Models\\AutomatedReportResult;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsCallbackService;\nuse Jiminny\\Services\\Kiosk\\AutomatedReports\\AutomatedReportsService;\nuse Psr\\Log\\LoggerInterface;\nuse Throwable;\n\nclass ReportController extends AbstractController\n{\n /**\n * Log prefix for all log messages\n */\n private const string LOG_PREFIX = '[Report Ready]';\n\n public function __construct(\n private readonly AutomatedReportsService $automatedReportsService,\n private readonly BusDispatcher $dispatcher,\n private readonly LoggerInterface $logger,\n private readonly AutomatedReportsCallbackService $callbackService,\n private readonly EventDispatcher $eventDispatcher,\n ) {\n }\n\n public function ready(Request $request): JsonResponse\n {\n $payload = $request->all();\n $now = Carbon::now();\n\n $this->logger->info(self::LOG_PREFIX . ' Webhook received', [\n 'payload' => $payload,\n ]);\n\n // validate\n $reportUuid = $this->callbackService->getResultUuid($payload);\n if (empty($reportUuid)) {\n return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);\n }\n\n try {\n $report = $this->automatedReportsService->getReportResult($reportUuid);\n\n // validate\n if ($this->callbackService->isProcessed($report)) {\n $this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [\n 'uuid' => $reportUuid,\n 'currentStatus' => $report->getStatusLabel(),\n ]);\n\n return response()->json(['status' => 'already_processed']);\n }\n\n // always try to get a child podcast cause report configuration cannot be trusted\n $reportPodcast = $this->automatedReportsService->findChildResult(\n result: $report,\n type: AutomatedReportsService::MEDIA_TYPE_PODCAST\n );\n\n // update results\n $report->update([\n 'status' => $this->callbackService->getPrimaryStatus($report, $payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n // if a podcast is set, update it\n $reportPodcast?->update([\n 'status' => $this->callbackService->getPodcastStatus($payload),\n 'response' => $payload,\n 'generated_at' => $now,\n ]);\n\n $this->logger->info(self::LOG_PREFIX . ' Report has been processed', [\n 'uuid' => $reportUuid,\n 'child_uuid' => $reportPodcast?->getUuid(),\n ]);\n\n if (! $this->callbackService->isSuccess($payload)) {\n $this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);\n\n return response()->json(['status' => 'ok']);\n }\n\n // If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)\n if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {\n // send the primary report\n $this->dispatcher->dispatch(new SendReportJob($reportUuid));\n\n // send the podcast report if it set and generated\n if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {\n $this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));\n }\n }\n\n // Track Datadog metrics for automated reports\n $automatedReport = $report->getReport();\n $this->callbackService->pushToDatadog($automatedReport, $report);\n\n if ($reportPodcast) {\n $this->callbackService->pushToDatadog($automatedReport, $reportPodcast);\n }\n\n $this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [\n 'report_uuid' => $automatedReport->getUuid(),\n 'result_uuid' => $reportUuid,\n ]);\n $this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));\n } catch (ModelNotFoundException $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Report not found', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);\n } catch (Throwable $exception) {\n $this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [\n 'uuid' => $reportUuid,\n 'error' => $exception->getMessage(),\n ]);\n\n return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);\n }\n\n return response()->json(['status' => 'ok']);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny_mars","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"4","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"13","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New File or Directory…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Expand Selected","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Collapse All","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4896694914393855596
|
6686649177356022861
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20725-handle-HS-search Project: faVsco.js, menu
JY-20725-handle-HS-search-rate-limit, menu
Start Listening for PHP Debug Connections
HandleHubspotRateLimitTest
Run 'HandleHubspotRateLimitTest'
Debug 'HandleHubspotRateLimitTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Controllers\Webhook;
use Carbon\Carbon;
use Illuminate\Contracts\Bus\Dispatcher as BusDispatcher;
use Illuminate\Contracts\Events\Dispatcher as EventDispatcher;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Jiminny\Events\AutomatedReports\AutomatedReportGenerated;
use Jiminny\Exceptions\ModelNotFoundException;
use Jiminny\Http\Controllers\AbstractController;
use Jiminny\Jobs\AutomatedReports\SendReportJob;
use Jiminny\Models\AutomatedReportResult;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsCallbackService;
use Jiminny\Services\Kiosk\AutomatedReports\AutomatedReportsService;
use Psr\Log\LoggerInterface;
use Throwable;
class ReportController extends AbstractController
{
/**
* Log prefix for all log messages
*/
private const string LOG_PREFIX = '[Report Ready]';
public function __construct(
private readonly AutomatedReportsService $automatedReportsService,
private readonly BusDispatcher $dispatcher,
private readonly LoggerInterface $logger,
private readonly AutomatedReportsCallbackService $callbackService,
private readonly EventDispatcher $eventDispatcher,
) {
}
public function ready(Request $request): JsonResponse
{
$payload = $request->all();
$now = Carbon::now();
$this->logger->info(self::LOG_PREFIX . ' Webhook received', [
'payload' => $payload,
]);
// validate
$reportUuid = $this->callbackService->getResultUuid($payload);
if (empty($reportUuid)) {
return response()->json(['status' => 'error', 'message' => 'Request ID is empty'], status: 400);
}
try {
$report = $this->automatedReportsService->getReportResult($reportUuid);
// validate
if ($this->callbackService->isProcessed($report)) {
$this->logger->warning(self::LOG_PREFIX . ' Report has been already processed', [
'uuid' => $reportUuid,
'currentStatus' => $report->getStatusLabel(),
]);
return response()->json(['status' => 'already_processed']);
}
// always try to get a child podcast cause report configuration cannot be trusted
$reportPodcast = $this->automatedReportsService->findChildResult(
result: $report,
type: AutomatedReportsService::MEDIA_TYPE_PODCAST
);
// update results
$report->update([
'status' => $this->callbackService->getPrimaryStatus($report, $payload),
'response' => $payload,
'generated_at' => $now,
]);
// if a podcast is set, update it
$reportPodcast?->update([
'status' => $this->callbackService->getPodcastStatus($payload),
'response' => $payload,
'generated_at' => $now,
]);
$this->logger->info(self::LOG_PREFIX . ' Report has been processed', [
'uuid' => $reportUuid,
'child_uuid' => $reportPodcast?->getUuid(),
]);
if (! $this->callbackService->isSuccess($payload)) {
$this->logger->warning(self::LOG_PREFIX . ' Error creating report', $payload);
return response()->json(['status' => 'ok']);
}
// If one-off, send the report immediately, if not leave it for the scheduler (automated-reports:send)
if ($report->getReport()->getFrequency() === AutomatedReportsService::FREQUENCY_ONE_OFF) {
// send the primary report
$this->dispatcher->dispatch(new SendReportJob($reportUuid));
// send the podcast report if it set and generated
if ($reportPodcast && $reportPodcast->getStatus() === AutomatedReportResult::STATUS_GENERATED) {
$this->dispatcher->dispatch(new SendReportJob(reportUuid: $reportPodcast->getUuid()));
}
}
// Track Datadog metrics for automated reports
$automatedReport = $report->getReport();
$this->callbackService->pushToDatadog($automatedReport, $report);
if ($reportPodcast) {
$this->callbackService->pushToDatadog($automatedReport, $reportPodcast);
}
$this->logger->info(self::LOG_PREFIX . ' Triggering Event for UserPilot tracking', [
'report_uuid' => $automatedReport->getUuid(),
'result_uuid' => $reportUuid,
]);
$this->eventDispatcher->dispatch(new AutomatedReportGenerated($automatedReport));
} catch (ModelNotFoundException $exception) {
$this->logger->error(self::LOG_PREFIX . ' Report not found', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Report not found'], status: 404);
} catch (Throwable $exception) {
$this->logger->error(self::LOG_PREFIX . ' Failed to update report status', [
'uuid' => $reportUuid,
'error' => $exception->getMessage(),
]);
return response()->json(['status' => 'error', 'message' => 'Failed to update report status'], status: 500);
}
return response()->json(['status' => 'ok']);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_mars
Sync Changes
Hide This Notification
Code changed:
Hide
4
1
13
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26638
|
1103
|
26
|
2026-05-12T12:50:35.050606+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590235050_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"bounds":{"left":0.0028257978,"top":0.057063047,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"bounds":{"left":0.0028257978,"top":0.08060654,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"bounds":{"left":0.015957447,"top":0.09217877,"width":0.40492022,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0028257978,"top":0.11332801,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.015957447,"top":0.12490024,"width":0.04138963,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.12051077,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.14604948,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.15762171,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"bounds":{"left":0.0,"top":0.17877094,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.19034317,"width":0.16140293,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.21149242,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.22306465,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"bounds":{"left":0.0,"top":0.2442139,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.25578612,"width":0.1200133,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.27693537,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.28850758,"width":0.1931516,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"bounds":{"left":0.0,"top":0.30965683,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.32122904,"width":0.07646277,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3423783,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.35395053,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"bounds":{"left":0.0,"top":0.37509975,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.386672,"width":0.09524601,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"bounds":{"left":0.0,"top":0.40782124,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.41939345,"width":0.053025264,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"bounds":{"left":0.0,"top":0.4405427,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"bounds":{"left":0.013297873,"top":0.4521149,"width":0.030418882,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.0028257978,"top":0.47486034,"width":0.07413564,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0028257978,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"bounds":{"left":0.013796543,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.024933511,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"bounds":{"left":0.036070477,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"bounds":{"left":0.04720745,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"bounds":{"left":0.07962101,"top":0.055067837,"width":0.021609042,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"bounds":{"left":0.079288565,"top":0.054269753,"width":0.0013297872,"height":0.0015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"bounds":{"left":0.079953454,"top":0.055067837,"width":0.01662234,"height":0.051476456},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"bounds":{"left":0.1015625,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"bounds":{"left":0.11818484,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"bounds":{"left":0.13480718,"top":0.0622506,"width":0.17952128,"height":0.023942538},"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"bounds":{"left":0.30103058,"top":0.06464485,"width":0.009973404,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"bounds":{"left":0.27942154,"top":0.06743815,"width":0.023271276,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"bounds":{"left":0.8128325,"top":0.055067837,"width":0.015957447,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"bounds":{"left":0.8287899,"top":0.058260176,"width":0.01662234,"height":0.031923383},"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"bounds":{"left":0.84541225,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"bounds":{"left":0.86203456,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"bounds":{"left":0.8786569,"top":0.055067837,"width":0.053690158,"height":0.03830806},"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"bounds":{"left":0.8843085,"top":0.06823623,"width":0.03706782,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"bounds":{"left":0.93234706,"top":0.055067837,"width":0.067652926,"height":0.03830806},"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"bounds":{"left":0.9353391,"top":0.057063047,"width":0.05435505,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"bounds":{"left":0.98204786,"top":0.075418994,"width":0.010638298,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"bounds":{"left":0.08228058,"top":0.09577015,"width":0.020279255,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"bounds":{"left":0.09291888,"top":0.1009577,"width":0.006981383,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"bounds":{"left":0.10255984,"top":0.09577015,"width":0.057513297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"bounds":{"left":0.11319814,"top":0.1009577,"width":0.044215426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"bounds":{"left":0.16007313,"top":0.09577015,"width":0.017952127,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"bounds":{"left":0.17071144,"top":0.1009577,"width":0.004654255,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"bounds":{"left":0.17802526,"top":0.09577015,"width":0.03507314,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"bounds":{"left":0.18866356,"top":0.1009577,"width":0.021775266,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"bounds":{"left":0.2130984,"top":0.09577015,"width":0.03523936,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"bounds":{"left":0.2237367,"top":0.1009577,"width":0.021941489,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"bounds":{"left":0.24833776,"top":0.09577015,"width":0.033909574,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"bounds":{"left":0.25897607,"top":0.1009577,"width":0.020611702,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"bounds":{"left":0.28224733,"top":0.09577015,"width":0.041888297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"bounds":{"left":0.29288563,"top":0.1009577,"width":0.028590426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"bounds":{"left":0.32413563,"top":0.09577015,"width":0.0631649,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"bounds":{"left":0.33477393,"top":0.1009577,"width":0.051861703,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"bounds":{"left":0.38730052,"top":0.09577015,"width":0.033410903,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"bounds":{"left":0.39793882,"top":0.1009577,"width":0.020113032,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"bounds":{"left":0.42071143,"top":0.09577015,"width":0.031416222,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"bounds":{"left":0.43134972,"top":0.1009577,"width":0.018118352,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"bounds":{"left":0.08494016,"top":0.12410215,"width":0.009973404,"height":0.023942538},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"bounds":{"left":0.098902926,"top":0.1272945,"width":0.026928192,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"bounds":{"left":0.099567816,"top":0.1292897,"width":0.025598405,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"bounds":{"left":0.13646941,"top":0.12809257,"width":0.028590426,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"bounds":{"left":0.13646941,"top":0.1292897,"width":0.028590426,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Query definition","depth":26,"bounds":{"left":0.09424867,"top":0.16959298,"width":0.05036569,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXButton","text":"Query definition","depth":28,"bounds":{"left":0.085605055,"top":0.16959298,"width":0.05900931,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Info : Query definition","depth":27,"bounds":{"left":0.14727394,"top":0.17557861,"width":0.0076462766,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log Analytics","depth":29,"bounds":{"left":0.17253989,"top":0.17517957,"width":0.02443484,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"a unified observability platform for a smoother experience, now in preview mode. Click","depth":28,"bounds":{"left":0.19963431,"top":0.1735834,"width":0.1853391,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"here","depth":28,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"here","depth":29,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"to try it out!","depth":28,"bounds":{"left":0.39444813,"top":0.1735834,"width":0.026595745,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"5m (5 Minutes)","depth":27,"bounds":{"left":0.7155917,"top":0.1707901,"width":0.012134309,"height":0.015961692},"on_screen":true,"help_text":"5 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"30m (30 Minutes)","depth":27,"bounds":{"left":0.73537236,"top":0.1707901,"width":0.014960106,"height":0.015961692},"on_screen":true,"help_text":"30 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"1h (1 Hour)","depth":27,"bounds":{"left":0.75797874,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"1 Hour","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"3h (3 Hours)","depth":27,"bounds":{"left":0.77642953,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"3 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"12h (12 Hours)","depth":27,"bounds":{"left":0.7947141,"top":0.1707901,"width":0.013630319,"height":0.015961692},"on_screen":true,"help_text":"12 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Custom","depth":27,"bounds":{"left":0.8159907,"top":0.1707901,"width":0.024268618,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Custom","depth":29,"bounds":{"left":0.8159907,"top":0.17158818,"width":0.016289894,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"Compare (Off)","depth":26,"bounds":{"left":0.84674203,"top":0.16679968,"width":0.046875,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Compare","depth":27,"bounds":{"left":0.8540558,"top":0.17238627,"width":0.019946808,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.87400264,"top":0.17238627,"width":0.0028257978,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Off","depth":27,"bounds":{"left":0.87682843,"top":0.17238627,"width":0.0078125,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.88464093,"top":0.17238627,"width":0.0016622341,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Time zone UTC timezone","depth":26,"bounds":{"left":0.8959442,"top":0.16679968,"width":0.046043884,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"UTC timezone","depth":28,"bounds":{"left":0.90026593,"top":0.17238627,"width":0.029421542,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Start tailing with selected log group (opens in a new tab)","depth":26,"bounds":{"left":0.9459774,"top":0.16679968,"width":0.048038565,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Start tailing","depth":27,"bounds":{"left":0.95994014,"top":0.17238627,"width":0.026761968,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query scope","depth":28,"bounds":{"left":0.085605055,"top":0.21827614,"width":0.027094414,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Query scope All log groups","depth":27,"bounds":{"left":0.085605055,"top":0.24102154,"width":0.06648936,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"All log groups","depth":29,"bounds":{"left":0.08992686,"top":0.24700718,"width":0.02925532,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"All log groups","depth":26,"bounds":{"left":0.15807846,"top":0.24102154,"width":0.73055184,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"search text field","subrole":"AXSearchField","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log class","depth":28,"bounds":{"left":0.8912899,"top":0.21827614,"width":0.019780586,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Log class STANDARD","depth":27,"bounds":{"left":0.8912899,"top":0.24102154,"width":0.04305186,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"STANDARD","depth":29,"bounds":{"left":0.8956117,"top":0.24700718,"width":0.023603724,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Account(s)","depth":28,"bounds":{"left":0.93700135,"top":0.21827614,"width":0.022938829,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Account(s) Change Account(s)","depth":27,"bounds":{"left":0.93700135,"top":0.24102154,"width":0.05319149,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Change Account(s)","depth":29,"bounds":{"left":0.94132316,"top":0.24700718,"width":0.038065158,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Remove All accounts","depth":29,"bounds":{"left":0.96825135,"top":0.27773345,"width":0.008643617,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Undo","depth":28,"bounds":{"left":0.94431514,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Redo","depth":28,"bounds":{"left":0.9562833,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXMenuButton","text":"Logs Insights QL","depth":29,"bounds":{"left":0.09125665,"top":0.4696728,"width":0.057679523,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Query generator","depth":26,"bounds":{"left":0.15159574,"top":0.4660814,"width":0.05236037,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Query generator","depth":28,"bounds":{"left":0.16356383,"top":0.4744613,"width":0.036402926,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Fields","depth":28,"bounds":{"left":0.21459441,"top":0.4744613,"width":0.012799202,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Saved and sample queries","depth":28,"bounds":{"left":0.24202128,"top":0.4744613,"width":0.05651596,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query commands","depth":28,"bounds":{"left":0.3131649,"top":0.4744613,"width":0.03856383,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Run query","depth":27,"bounds":{"left":0.085605055,"top":0.509178,"width":0.03723404,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Cancel","depth":27,"bounds":{"left":0.12549867,"top":0.509178,"width":0.02925532,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Save","depth":27,"bounds":{"left":0.15741356,"top":0.509178,"width":0.024933511,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"History","depth":27,"bounds":{"left":0.24634309,"top":0.509178,"width":0.030751329,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Completed. Query executed for","depth":28,"bounds":{"left":0.09225399,"top":0.5422985,"width":0.06615692,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"78 log groups.","depth":28,"bounds":{"left":0.15957446,"top":0.5422985,"width":0.03025266,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"View log groups used in query","depth":28,"bounds":{"left":0.19099069,"top":0.5422985,"width":0.005319149,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Logs (5)","depth":25,"bounds":{"left":0.081615694,"top":0.57781327,"width":0.028091755,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"Logs","depth":27,"bounds":{"left":0.085605055,"top":0.58739024,"width":0.011469414,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.09857048,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"5","depth":27,"bounds":{"left":0.100398935,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.103557184,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Patterns (1)","depth":25,"bounds":{"left":0.115359046,"top":0.57781327,"width":0.03756649,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Patterns","depth":27,"bounds":{"left":0.11934841,"top":0.58739024,"width":0.021110373,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.14045878,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"1","depth":27,"bounds":{"left":0.14361702,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.14677526,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Visualization","depth":25,"bounds":{"left":0.15857713,"top":0.57781327,"width":0.04089096,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Visualization","depth":27,"bounds":{"left":0.16256648,"top":0.58739024,"width":0.032579787,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Logs (5)","depth":26,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Logs (5)","depth":27,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Summarize results","depth":26,"bounds":{"left":0.6627327,"top":0.61851555,"width":0.06216755,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Summarize results","depth":27,"bounds":{"left":0.67669547,"top":0.62450117,"width":0.04089096,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Investigate","depth":28,"bounds":{"left":0.72755986,"top":0.61851555,"width":0.05285904,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Investigate","depth":29,"bounds":{"left":0.7421875,"top":0.62450117,"width":0.024268618,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Share results","depth":26,"bounds":{"left":0.78307843,"top":0.61851555,"width":0.050033245,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Share results","depth":27,"bounds":{"left":0.79704124,"top":0.62450117,"width":0.028756648,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Export results","depth":28,"bounds":{"left":0.83577126,"top":0.61851555,"width":0.052027926,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Export results","depth":29,"bounds":{"left":0.8430851,"top":0.62450117,"width":0.030751329,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Add to dashboard","depth":26,"bounds":{"left":0.89045876,"top":0.61851555,"width":0.054022606,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Showing 5 of 5 records matched","depth":29,"bounds":{"left":0.4865359,"top":0.6584198,"width":0.075465426,"height":0.016759777},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)","depth":29,"bounds":{"left":0.4381649,"top":0.6763767,"width":0.17204122,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Hide histogram","depth":26,"bounds":{"left":0.9665891,"top":0.65682364,"width":0.031083776,"height":0.03431764},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Hide histogram","depth":27,"bounds":{"left":0.9665891,"top":0.65881884,"width":0.027759308,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"Filter table results","depth":25,"bounds":{"left":0.08261303,"top":0.7765363,"width":0.21542554,"height":0.025538707},"on_screen":true,"help_text":"","placeholder":"Filter table results (case insensitive)...","role_description":"search text field","subrole":"AXSearchField","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
5669092262474275003
|
9095371956125561012
|
app_switch
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26639
|
1103
|
27
|
2026-05-12T12:50:35.652829+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590235652_m2.jpg...
|
Firefox
|
CloudWatch | us-east-2 — Work
|
True
|
us-east-2.console.aws.amazon.com/cloudwatch/home?r us-east-2.console.aws.amazon.com/cloudwatch/home?region=us-east-2#logsV2:logs-insights$3FqueryDetail$3D~(end~0~start~-43200~timeType~'RELATIVE~tz~'UTC~unit~'seconds~editorString~'fields*20*40timestamp*2c*20*40message*2c*20*40logStream*2c*20*40log*0a*7c*20filter*20*40message*20like*20*22Triggering*20Event*20for*20UserPilot*20tracking*22*20*0a*7c*20filter*20*40message*20not*20like*20*2fAnalytic*2f*20*7c*20filter*20*40message*20not*20like*20*2fTranscript*2f*0a*7c*20filter*20*40message*20not*20like*20*2fWebhook*2f*20*7c*20filter*20*40message*20not*20like*20*2fMeetingBot*2f*20*0a*7c*20limit*2010000~queryId~'0551e814-f51a-4339-8372-80d7ba4cef27~source~(~'*2a)~lang~'CWLI~logClass~'STANDARD~accountIDs~(~'All)~queryBy~'allLogGroups)...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Unnamed Group","depth":4,"bounds":{"left":0.0028257978,"top":0.057063047,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXRadioButton","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":4,"bounds":{"left":0.0028257978,"top":0.08060654,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"TypeError: League\\Flysystem\\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app","depth":5,"bounds":{"left":0.015957447,"top":0.09217877,"width":0.40492022,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0028257978,"top":0.11332801,"width":0.07679521,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.015957447,"top":0.12490024,"width":0.04138963,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.06732048,"top":0.12051077,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.14604948,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.15762171,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":4,"bounds":{"left":0.0,"top":0.17877094,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.19034317,"width":0.16140293,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.21149242,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.22306465,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":4,"bounds":{"left":0.0,"top":0.2442139,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20773] User Pilot not receiving events on report generated - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.25578612,"width":0.1200133,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.27693537,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.28850758,"width":0.1931516,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20776] Automated report - sentry - Jira","depth":4,"bounds":{"left":0.0,"top":0.30965683,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20776] Automated report - sentry - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.32122904,"width":0.07646277,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3423783,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.35395053,"width":0.18816489,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":4,"bounds":{"left":0.0,"top":0.37509975,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6793] Les Mills activity types not pulling in - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.386672,"width":0.09524601,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Platform Team - Backlog - Jira","depth":4,"bounds":{"left":0.0,"top":0.40782124,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Team - Backlog - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.41939345,"width":0.053025264,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Userpilot | Events","depth":4,"bounds":{"left":0.0,"top":0.4405427,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Userpilot | Events","depth":5,"bounds":{"left":0.013297873,"top":0.4521149,"width":0.030418882,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.0028257978,"top":0.47486034,"width":0.07413564,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0028257978,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (⌃X)","depth":6,"bounds":{"left":0.013796543,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.024933511,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (⇧⌘H)","depth":6,"bounds":{"left":0.036070477,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (⌘B)","depth":6,"bounds":{"left":0.04720745,"top":0.97007185,"width":0.010638298,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"AWS Console Home","depth":13,"bounds":{"left":0.07962101,"top":0.055067837,"width":0.021609042,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"Skip to Main Content","depth":13,"bounds":{"left":0.079288565,"top":0.054269753,"width":0.0013297872,"height":0.0015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Skip to Main Content","depth":14,"bounds":{"left":0.079953454,"top":0.055067837,"width":0.01662234,"height":0.051476456},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon Q","depth":14,"bounds":{"left":0.1015625,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Services","depth":13,"bounds":{"left":0.11818484,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"Search","depth":16,"bounds":{"left":0.13480718,"top":0.0622506,"width":0.17952128,"height":0.023942538},"on_screen":true,"role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ask Amazon Q","depth":15,"bounds":{"left":0.30103058,"top":0.06464485,"width":0.009973404,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[Option+S]","depth":16,"bounds":{"left":0.27942154,"top":0.06743815,"width":0.023271276,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"CloudShell","depth":14,"bounds":{"left":0.8128325,"top":0.055067837,"width":0.015957447,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Notifications (none available)","depth":16,"bounds":{"left":0.8287899,"top":0.058260176,"width":0.01662234,"height":0.031923383},"on_screen":true,"help_text":"Notifications","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Help & support","depth":15,"bounds":{"left":0.84541225,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Settings","depth":15,"bounds":{"left":0.86203456,"top":0.055067837,"width":0.01662234,"height":0.03830806},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXComboBox","text":"United States (Ohio)","depth":15,"bounds":{"left":0.8786569,"top":0.055067837,"width":0.053690158,"height":0.03830806},"on_screen":true,"value":"United States (Ohio)","help_text":"United States (Ohio)","role_description":"combo box","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"United States (Ohio)","depth":17,"bounds":{"left":0.8843085,"top":0.06823623,"width":0.03706782,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"PROD","depth":15,"bounds":{"left":0.93234706,"top":0.055067837,"width":0.067652926,"height":0.03830806},"on_screen":true,"help_text":"Production_View_Only @ jiminny","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Account ID: 4103-4619-5943","depth":19,"bounds":{"left":0.9353391,"top":0.057063047,"width":0.05435505,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PROD","depth":18,"bounds":{"left":0.98204786,"top":0.075418994,"width":0.010638298,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"EC2 EC2","depth":16,"bounds":{"left":0.08228058,"top":0.09577015,"width":0.020279255,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"EC2","depth":18,"bounds":{"left":0.09291888,"top":0.1009577,"width":0.006981383,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Elastic Container Service Elastic Container Service","depth":16,"bounds":{"left":0.10255984,"top":0.09577015,"width":0.057513297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Elastic Container Service","depth":18,"bounds":{"left":0.11319814,"top":0.1009577,"width":0.044215426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"S3 S3","depth":16,"bounds":{"left":0.16007313,"top":0.09577015,"width":0.017952127,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"S3","depth":18,"bounds":{"left":0.17071144,"top":0.1009577,"width":0.004654255,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CodeDeploy CodeDeploy","depth":16,"bounds":{"left":0.17802526,"top":0.09577015,"width":0.03507314,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CodeDeploy","depth":18,"bounds":{"left":0.18866356,"top":0.1009577,"width":0.021775266,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudWatch CloudWatch","depth":16,"bounds":{"left":0.2130984,"top":0.09577015,"width":0.03523936,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":18,"bounds":{"left":0.2237367,"top":0.1009577,"width":0.021941489,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"ElastiCache ElastiCache","depth":16,"bounds":{"left":0.24833776,"top":0.09577015,"width":0.033909574,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"ElastiCache","depth":18,"bounds":{"left":0.25897607,"top":0.1009577,"width":0.020611702,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Aurora and RDS Aurora and RDS","depth":16,"bounds":{"left":0.28224733,"top":0.09577015,"width":0.041888297,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Aurora and RDS","depth":18,"bounds":{"left":0.29288563,"top":0.1009577,"width":0.028590426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Amazon OpenSearch Service Amazon OpenSearch Service","depth":16,"bounds":{"left":0.32413563,"top":0.09577015,"width":0.0631649,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Amazon OpenSearch Service","depth":18,"bounds":{"left":0.33477393,"top":0.1009577,"width":0.051861703,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudFront CloudFront","depth":16,"bounds":{"left":0.38730052,"top":0.09577015,"width":0.033410903,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudFront","depth":18,"bounds":{"left":0.39793882,"top":0.1009577,"width":0.020113032,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"MediaLive MediaLive","depth":16,"bounds":{"left":0.42071143,"top":0.09577015,"width":0.031416222,"height":0.022346368},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"MediaLive","depth":18,"bounds":{"left":0.43134972,"top":0.1009577,"width":0.018118352,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Open side navigation","depth":13,"bounds":{"left":0.08494016,"top":0.12410215,"width":0.009973404,"height":0.023942538},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"CloudWatch","depth":14,"bounds":{"left":0.098902926,"top":0.1272945,"width":0.026928192,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch","depth":16,"bounds":{"left":0.099567816,"top":0.1292897,"width":0.025598405,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Logs Insights","depth":14,"bounds":{"left":0.13646941,"top":0.12809257,"width":0.028590426,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Logs Insights","depth":16,"bounds":{"left":0.13646941,"top":0.1292897,"width":0.028590426,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Query definition","depth":26,"bounds":{"left":0.09424867,"top":0.16959298,"width":0.05036569,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXButton","text":"Query definition","depth":28,"bounds":{"left":0.085605055,"top":0.16959298,"width":0.05900931,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Info : Query definition","depth":27,"bounds":{"left":0.14727394,"top":0.17557861,"width":0.0076462766,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log Analytics","depth":29,"bounds":{"left":0.17253989,"top":0.17517957,"width":0.02443484,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"a unified observability platform for a smoother experience, now in preview mode. Click","depth":28,"bounds":{"left":0.19963431,"top":0.1735834,"width":0.1853391,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"here","depth":28,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"here","depth":29,"bounds":{"left":0.3849734,"top":0.1735834,"width":0.009474734,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"to try it out!","depth":28,"bounds":{"left":0.39444813,"top":0.1735834,"width":0.026595745,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"5m (5 Minutes)","depth":27,"bounds":{"left":0.7155917,"top":0.1707901,"width":0.012134309,"height":0.015961692},"on_screen":true,"help_text":"5 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"30m (30 Minutes)","depth":27,"bounds":{"left":0.73537236,"top":0.1707901,"width":0.014960106,"height":0.015961692},"on_screen":true,"help_text":"30 Minutes","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"1h (1 Hour)","depth":27,"bounds":{"left":0.75797874,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"1 Hour","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"3h (3 Hours)","depth":27,"bounds":{"left":0.77642953,"top":0.1707901,"width":0.010804521,"height":0.015961692},"on_screen":true,"help_text":"3 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"12h (12 Hours)","depth":27,"bounds":{"left":0.7947141,"top":0.1707901,"width":0.013630319,"height":0.015961692},"on_screen":true,"help_text":"12 Hours","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Custom","depth":27,"bounds":{"left":0.8159907,"top":0.1707901,"width":0.024268618,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Custom","depth":29,"bounds":{"left":0.8159907,"top":0.17158818,"width":0.016289894,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXCheckBox","text":"Compare (Off)","depth":26,"bounds":{"left":0.84674203,"top":0.16679968,"width":0.046875,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Compare","depth":27,"bounds":{"left":0.8540558,"top":0.17238627,"width":0.019946808,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.87400264,"top":0.17238627,"width":0.0028257978,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Off","depth":27,"bounds":{"left":0.87682843,"top":0.17238627,"width":0.0078125,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.88464093,"top":0.17238627,"width":0.0016622341,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Time zone UTC timezone","depth":26,"bounds":{"left":0.8959442,"top":0.16679968,"width":0.046043884,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"UTC timezone","depth":28,"bounds":{"left":0.90026593,"top":0.17238627,"width":0.029421542,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Start tailing with selected log group (opens in a new tab)","depth":26,"bounds":{"left":0.9459774,"top":0.16679968,"width":0.048038565,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Start tailing","depth":27,"bounds":{"left":0.95994014,"top":0.17238627,"width":0.026761968,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query scope","depth":28,"bounds":{"left":0.085605055,"top":0.21827614,"width":0.027094414,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Query scope All log groups","depth":27,"bounds":{"left":0.085605055,"top":0.24102154,"width":0.06648936,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"All log groups","depth":29,"bounds":{"left":0.08992686,"top":0.24700718,"width":0.02925532,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"All log groups","depth":26,"bounds":{"left":0.15807846,"top":0.24102154,"width":0.73055184,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"search text field","subrole":"AXSearchField","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Log class","depth":28,"bounds":{"left":0.8912899,"top":0.21827614,"width":0.019780586,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Log class STANDARD","depth":27,"bounds":{"left":0.8912899,"top":0.24102154,"width":0.04305186,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"STANDARD","depth":29,"bounds":{"left":0.8956117,"top":0.24700718,"width":0.023603724,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Account(s)","depth":28,"bounds":{"left":0.93700135,"top":0.21827614,"width":0.022938829,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Account(s) Change Account(s)","depth":27,"bounds":{"left":0.93700135,"top":0.24102154,"width":0.05319149,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Change Account(s)","depth":29,"bounds":{"left":0.94132316,"top":0.24700718,"width":0.038065158,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Remove All accounts","depth":29,"bounds":{"left":0.96825135,"top":0.27773345,"width":0.008643617,"height":0.017557861},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Undo","depth":28,"bounds":{"left":0.94431514,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Redo","depth":28,"bounds":{"left":0.9562833,"top":0.43575418,"width":0.00930851,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXMenuButton","text":"Logs Insights QL","depth":29,"bounds":{"left":0.09125665,"top":0.4696728,"width":0.057679523,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Query generator","depth":26,"bounds":{"left":0.15159574,"top":0.4660814,"width":0.05236037,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Query generator","depth":28,"bounds":{"left":0.16356383,"top":0.4744613,"width":0.036402926,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Fields","depth":28,"bounds":{"left":0.21459441,"top":0.4744613,"width":0.012799202,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Saved and sample queries","depth":28,"bounds":{"left":0.24202128,"top":0.4744613,"width":0.05651596,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Query commands","depth":28,"bounds":{"left":0.3131649,"top":0.4744613,"width":0.03856383,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Run query","depth":27,"bounds":{"left":0.085605055,"top":0.509178,"width":0.03723404,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Cancel","depth":27,"bounds":{"left":0.12549867,"top":0.509178,"width":0.02925532,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Save","depth":27,"bounds":{"left":0.15741356,"top":0.509178,"width":0.024933511,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"History","depth":27,"bounds":{"left":0.24634309,"top":0.509178,"width":0.030751329,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Completed. Query executed for","depth":28,"bounds":{"left":0.09225399,"top":0.5422985,"width":0.06615692,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"78 log groups.","depth":28,"bounds":{"left":0.15957446,"top":0.5422985,"width":0.03025266,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"View log groups used in query","depth":28,"bounds":{"left":0.19099069,"top":0.5422985,"width":0.005319149,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXRadioButton","text":"Logs (5)","depth":25,"bounds":{"left":0.081615694,"top":0.57781327,"width":0.028091755,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXStaticText","text":"Logs","depth":27,"bounds":{"left":0.085605055,"top":0.58739024,"width":0.011469414,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.09857048,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"5","depth":27,"bounds":{"left":0.100398935,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.103557184,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Patterns (1)","depth":25,"bounds":{"left":0.115359046,"top":0.57781327,"width":0.03756649,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Patterns","depth":27,"bounds":{"left":0.11934841,"top":0.58739024,"width":0.021110373,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"(","depth":27,"bounds":{"left":0.14045878,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"1","depth":27,"bounds":{"left":0.14361702,"top":0.58739024,"width":0.0031582448,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":")","depth":27,"bounds":{"left":0.14677526,"top":0.58739024,"width":0.0018284575,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Visualization","depth":25,"bounds":{"left":0.15857713,"top":0.57781327,"width":0.04089096,"height":0.035115723},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Visualization","depth":27,"bounds":{"left":0.16256648,"top":0.58739024,"width":0.032579787,"height":0.015961692},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"Logs (5)","depth":26,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Logs (5)","depth":27,"bounds":{"left":0.0852726,"top":0.62330407,"width":0.023936171,"height":0.01915403},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Summarize results","depth":26,"bounds":{"left":0.6627327,"top":0.61851555,"width":0.06216755,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Summarize results","depth":27,"bounds":{"left":0.67669547,"top":0.62450117,"width":0.04089096,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Investigate","depth":28,"bounds":{"left":0.72755986,"top":0.61851555,"width":0.05285904,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Investigate","depth":29,"bounds":{"left":0.7421875,"top":0.62450117,"width":0.024268618,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Share results","depth":26,"bounds":{"left":0.78307843,"top":0.61851555,"width":0.050033245,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Share results","depth":27,"bounds":{"left":0.79704124,"top":0.62450117,"width":0.028756648,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXMenuButton","text":"Export results","depth":28,"bounds":{"left":0.83577126,"top":0.61851555,"width":0.052027926,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"menu button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Export results","depth":29,"bounds":{"left":0.8430851,"top":0.62450117,"width":0.030751329,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Add to dashboard","depth":26,"bounds":{"left":0.89045876,"top":0.61851555,"width":0.054022606,"height":0.025538707},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Showing 5 of 5 records matched","depth":29,"bounds":{"left":0.4865359,"top":0.6584198,"width":0.075465426,"height":0.016759777},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)","depth":29,"bounds":{"left":0.4381649,"top":0.6763767,"width":0.17204122,"height":0.01396648},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Hide histogram","depth":26,"bounds":{"left":0.9665891,"top":0.65682364,"width":0.031083776,"height":0.03431764},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Hide histogram","depth":27,"bounds":{"left":0.9665891,"top":0.65881884,"width":0.027759308,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXTextField","text":"Filter table results","depth":25,"bounds":{"left":0.08261303,"top":0.7765363,"width":0.21542554,"height":0.025538707},"on_screen":true,"help_text":"","placeholder":"Filter table results (case insensitive)...","role_description":"search text field","subrole":"AXSearchField","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:47:09.311Z","depth":29,"bounds":{"left":0.09790558,"top":0.85315245,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T10:04:46.728Z","depth":29,"bounds":{"left":0.09790558,"top":0.8747007,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T09:20:38.392Z","depth":29,"bounds":{"left":0.09790558,"top":0.896249,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:31.669Z","depth":29,"bounds":{"left":0.09790558,"top":0.91779727,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026-05-12T01:00:28.884Z","depth":29,"bounds":{"left":0.09790558,"top":0.9393456,"width":0.057513297,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"996be821-39f2-4a46-9902-0a314990d7cf\"} {\"correlation_id\":\"fc9b0276-0d21-4bc8-b0ff-f42ce4846764\",\"trace_id\":\"67e47fde-55e0-4e4f-b067-d4a98ffad121\"}","depth":29,"bounds":{"left":0.16289894,"top":0.85315245,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"23a4622e-3d94-4bba-b328-bc6a362d0ecf\",\"result_uuid\":\"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6\"} {\"correlation_id\":\"7160a5ac-37a5-49ca-b207-c6e254706e42\",\"trace_id\":\"aaef8a56-cb6f-4a43-bd3c-3527366179e5\"}","depth":29,"bounds":{"left":0.16289894,"top":0.8747007,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"52866e30-9ab9-4ce8-a51d-d89bd35ccec4\",\"result_uuid\":\"8b73292d-3d61-4759-9317-c3a9becf2de9\"} {\"correlation_id\":\"5ff52579-44c5-42c3-8ef5-8a5f70688285\",\"trace_id\":\"c76030e6-66c4-43e8-b3e0-9fd5152fb497\"}","depth":29,"bounds":{"left":0.16289894,"top":0.896249,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"d08c3a32-01fc-4485-9315-5c8354633195\",\"result_uuid\":\"7a8bce2b-3c60-41b0-a47f-85d223da1a67\"} {\"correlation_id\":\"3311a501-cdf8-4682-8389-91076ab23365\",\"trace_id\":\"2486d7a7-766c-493e-a947-68039e4d5a26\"}","depth":29,"bounds":{"left":0.16289894,"top":0.91779727,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {\"report_uuid\":\"8b74812a-9116-4e76-82b5-f56f4a3eaf01\",\"result_uuid\":\"f256c546-3b5e-4f82-b902-40b293d602fe\"} {\"correlation_id\":\"7d73decd-9db9-4991-baa2-10e4632de288\",\"trace_id\":\"950727b7-8fce-41ec-89e4-0ea4da07dbda\"}","depth":29,"bounds":{"left":0.16289894,"top":0.9393456,"width":0.7898936,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.85315245,"width":0.11020612,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.8747007,"width":0.111369684,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.896249,"width":0.110538565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.91779727,"width":0.11153591,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXLink","text":"php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab","depth":29,"bounds":{"left":0.5159575,"top":0.9393456,"width":0.112034574,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.85315245,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.8747007,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.896249,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.91779727,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"410346195943:php-app","depth":29,"bounds":{"left":0.640625,"top":0.9393456,"width":0.047872342,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Completed. Query executed for 78 log groups.","depth":19,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"CloudShell","depth":12,"bounds":{"left":0.08494016,"top":0.9784517,"width":0.02642952,"height":0.015961692},"on_screen":true,"help_text":"Open CloudShell","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudShell","depth":14,"bounds":{"left":0.091921546,"top":0.98044693,"width":0.019448139,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Feedback","depth":11,"bounds":{"left":0.11968085,"top":0.980846,"width":0.017121011,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Feedback","depth":13,"bounds":{"left":0.11968085,"top":0.98044693,"width":0.017121011,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"©","depth":12,"bounds":{"left":0.8159907,"top":0.98044693,"width":0.004155585,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"2026","depth":12,"bounds":{"left":0.82014626,"top":0.98044693,"width":0.00930851,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":",","depth":12,"bounds":{"left":0.8294548,"top":0.98044693,"width":0.0019946808,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Amazon Web Services, Inc.","depth":12,"bounds":{"left":0.83144945,"top":0.98044693,"width":0.048038565,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"or its affiliates.","depth":12,"bounds":{"left":0.88048536,"top":0.98044693,"width":0.026595745,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Privacy","depth":13,"bounds":{"left":0.91705453,"top":0.9796488,"width":0.014295213,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Privacy","depth":14,"bounds":{"left":0.9177194,"top":0.98044693,"width":0.012965426,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXLink","text":"Terms","depth":13,"bounds":{"left":0.9396609,"top":0.9796488,"width":0.012300532,"height":0.013567438},"on_screen":true,"help_text":"","role_description":"link","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Terms","depth":14,"bounds":{"left":0.9403258,"top":0.98044693,"width":0.010970744,"height":0.011971269},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Cookie preferences","depth":13,"bounds":{"left":0.9602726,"top":0.980846,"width":0.034408245,"height":0.011173184},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
6780981576055161636
|
-272112794895568460
|
visual_change
|
accessibility
|
NULL
|
Unnamed Group
TypeError: League\Flysystem\Filesyst Unnamed Group
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
TypeError: League\Flysystem\Filesystem::has(): Argument #1 ($location) must be of type string, null given, called in /home/jiminny/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 218 — jiminny — app
CloudWatch | us-east-2
CloudWatch | us-east-2
Close tab
Pipelines - jiminny/app
Pipelines - jiminny/app
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
[JY-20725] [HubSpot] Optimise CRM rematching on delete hubspot accounts/contacts - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[JY-20773] User Pilot not receiving events on report generated - Jira
[JY-20773] User Pilot not receiving events on report generated - Jira
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
JY-20773 fix user pilot tracking for automated report generated by LakyLak · Pull Request #12024 · jiminny/app
[JY-20776] Automated report - sentry - Jira
[JY-20776] Automated report - sentry - Jira
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
JY-20725 add HS rate limit handling on activities rematching by LakyLak · Pull Request #12066 · jiminny/app
[SRD-6793] Les Mills activity types not pulling in - Jira
[SRD-6793] Les Mills activity types not pulling in - Jira
Platform Team - Backlog - Jira
Platform Team - Backlog - Jira
Userpilot | Events
Userpilot | Events
New Tab
Customize sidebar
Open Google Gemini (⌃X)
Tabs from other devices
Open history (⇧⌘H)
Open bookmarks (⌘B)
AWS Console Home
Skip to Main Content
Skip to Main Content
Amazon Q
Services
Search
Ask Amazon Q
[Option+S]
CloudShell
Notifications (none available)
Help & support
Settings
United States (Ohio)
United States (Ohio)
PROD
Account ID: 4103-4619-5943
PROD
EC2 EC2
EC2
Elastic Container Service Elastic Container Service
Elastic Container Service
S3 S3
S3
CodeDeploy CodeDeploy
CodeDeploy
CloudWatch CloudWatch
CloudWatch
ElastiCache ElastiCache
ElastiCache
Aurora and RDS Aurora and RDS
Aurora and RDS
Amazon OpenSearch Service Amazon OpenSearch Service
Amazon OpenSearch Service
CloudFront CloudFront
CloudFront
MediaLive MediaLive
MediaLive
Open side navigation
CloudWatch
CloudWatch
Logs Insights
Logs Insights
Query definition
Query definition
Info : Query definition
Log Analytics
a unified observability platform for a smoother experience, now in preview mode. Click
here
here
to try it out!
5m (5 Minutes)
30m (30 Minutes)
1h (1 Hour)
3h (3 Hours)
12h (12 Hours)
Custom
Custom
Compare (Off)
Compare
(
Off
)
Time zone UTC timezone
UTC timezone
Start tailing with selected log group (opens in a new tab)
Start tailing
Query scope
Query scope All log groups
All log groups
All log groups
Log class
Log class STANDARD
STANDARD
Account(s)
Account(s) Change Account(s)
Change Account(s)
Remove All accounts
Undo
Redo
Logs Insights QL
Query generator
Query generator
Fields
Saved and sample queries
Query commands
Run query
Cancel
Save
History
Completed. Query executed for
78 log groups.
View log groups used in query
Logs (5)
Logs
(
5
)
Patterns (1)
Patterns
(
1
)
Visualization
Visualization
Logs (5)
Logs (5)
Summarize results
Summarize results
Investigate
Investigate
Share results
Share results
Export results
Export results
Add to dashboard
Showing 5 of 5 records matched
23,884,418 records (7.0 GB) scanned in 17.6s @ 1,353,684 records/s (404.0 MB/s)
Hide histogram
Hide histogram
Filter table results
2026-05-12T10:47:09.311Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
410346195943:php-app
2026-05-12T10:04:46.728Z
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
410346195943:php-app
2026-05-12T09:20:38.392Z
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:31.669Z
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
410346195943:php-app
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
2026-05-12T10:47:09.311Z
2026-05-12T10:04:46.728Z
2026-05-12T09:20:38.392Z
2026-05-12T01:00:31.669Z
2026-05-12T01:00:28.884Z
NOTICE: PHP message: [2026-05-12 10:47:09] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"996be821-39f2-4a46-9902-0a314990d7cf"} {"correlation_id":"fc9b0276-0d21-4bc8-b0ff-f42ce4846764","trace_id":"67e47fde-55e0-4e4f-b067-d4a98ffad121"}
NOTICE: PHP message: [2026-05-12 10:04:46] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"23a4622e-3d94-4bba-b328-bc6a362d0ecf","result_uuid":"787f3ee9-dec2-4bd0-8eaa-b3795e539cc6"} {"correlation_id":"7160a5ac-37a5-49ca-b207-c6e254706e42","trace_id":"aaef8a56-cb6f-4a43-bd3c-3527366179e5"}
NOTICE: PHP message: [2026-05-12 09:20:38] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"52866e30-9ab9-4ce8-a51d-d89bd35ccec4","result_uuid":"8b73292d-3d61-4759-9317-c3a9becf2de9"} {"correlation_id":"5ff52579-44c5-42c3-8ef5-8a5f70688285","trace_id":"c76030e6-66c4-43e8-b3e0-9fd5152fb497"}
NOTICE: PHP message: [2026-05-12 01:00:31] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"d08c3a32-01fc-4485-9315-5c8354633195","result_uuid":"7a8bce2b-3c60-41b0-a47f-85d223da1a67"} {"correlation_id":"3311a501-cdf8-4682-8389-91076ab23365","trace_id":"2486d7a7-766c-493e-a947-68039e4d5a26"}
NOTICE: PHP message: [2026-05-12 01:00:28] production.INFO: [Report Ready] Triggering Event for UserPilot tracking {"report_uuid":"8b74812a-9116-4e76-82b5-f56f4a3eaf01","result_uuid":"f256c546-3b5e-4f82-b902-40b293d602fe"} {"correlation_id":"7d73decd-9db9-4991-baa2-10e4632de288","trace_id":"950727b7-8fce-41ec-89e4-0ea4da07dbda"}
php-app/php-app/f9708a4ce3c04f409457613e51ff01d8 Opens in a new tab
php-app/php-app/26f1cb9abf0741c785f4eb93ad730784 Opens in a new tab
php-app/php-app/7c976ed843c0428faab97fad2f3421c2 Opens in a new tab
php-app/php-app/290cca34cb0842d18ef788c7b4ec6b52 Opens in a new tab
php-app/php-app/81547f694a0345619f77bf95aaad3d08 Opens in a new tab
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
410346195943:php-app
Completed. Query executed for 78 log groups.
CloudShell
CloudShell
Feedback
Feedback
©
2026
,
Amazon Web Services, Inc.
or its affiliates.
Privacy
Privacy
Terms
Terms
Cookie preferences...
|
26638
|
NULL
|
NULL
|
NULL
|
|
26641
|
1102
|
17
|
2026-05-12T12:50:37.409209+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590237409_m1.jpg...
|
Claude
|
Claude
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error...
|
[{"role":"AXLink","text":& [{"role":"AXLink","text":"Skip to content","depth":14,"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Skip to content","depth":15,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Click to collapse","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"⌘B","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Drag to resize","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Collapse sidebar","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cowork","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New chat ⌘N","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"New chat","depth":16,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"⌘N","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Projects","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Artifacts","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Customize","depth":15,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Pinned","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Bulgarian citizenship application process for EU residents","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Bulgarian citizenship application process for EU residents","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Dawarich location tracking project","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Dawarich location tracking project","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Recents","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"View all","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe data sync and retention management","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe data sync and retention management","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync script failing after recent migrations","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync script failing after recent migrations","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hubspot BadRequest headers debugging","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Hubspot BadRequest headers debugging","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Monthly expense tracking","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Monthly expense tracking","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Exporting transaction data from Notion to finance hub","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Exporting transaction data from Notion to finance hub","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 How much have I spent for groc…","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 How much have I spent for groc…","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"April 2026 spending by category","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for April 2026 spending by category","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code diff review","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Code diff review","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit implementation strategy","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit implementation strategy","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe retention policy code location","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe retention policy code location","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Viewing retention policy in screenpipe","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Viewing retention policy in screenpipe","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Clean shot x video recording termination issue","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Clean shot x video recording termination issue","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit handling with executeRequest","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit handling with executeRequest","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Untitled","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 Screen pipe. Is there ability…","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 Screen pipe. Is there ability…","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"SMB mount access inconsistency between Finder and iTerm","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for SMB mount access inconsistency between Finder and iTerm","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 What is the best switch I can…","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 What is the best switch I can…","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Permission denied on screenpipe volume","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Permission denied on screenpipe volume","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync database attachment error","depth":18,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync database attachment error","depth":19,"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-3582418919819255319
|
-7921832188788646379
|
app_switch
|
hybrid
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error
SlackFileEditViewGoHistoryWindowHelp(ab)Retro - Platform - in 1h 10 mAsshDOCKER• 81DEV (-zsh)О ₴2APP (-zsh)• *[EMAIL]@Lukas-Kovaliks-MacBook-Pro-Jiminny~/.screenpipe/data $ cd ..[EMAIL] $ nasAdm1n@DXP4800PLUS-B5F8: ~$cd/volumel/screenpipe/Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes 1ltotal26Gdrwxrwxrwx+1rootroot410 May1215:15drwxr-xr-xrootroot450 Apr2519:39drwxrwxrwx+1Adminadmin202 Apr2620:10drwxrwxrwx+1Adminadmin298 May1013:46drwxrwxrwx+Adminadmin144 May09:41drwxrwxrwx+1Admin admin70 May1013:47drwxrwxrwx+1Adminadmin164 Apr1116:51drwxrwxrwx+1rootroot5.1KMay1120:55-rwxrwxrwx+1rootroot31Apr1817:42app_settings.json1Adminadmin13G May1120:55archive.db-rwxrwxrwx+1Adminadmin11G May10-rwxrwxrwx+Adm1n admin 3.5G May1112:31archive.db-bak20:15db.sqlite-rwxrwxrwx+1Admin admin32K May1205:48db.sqlite-shm-rwxrwxrwx+ 1Admin admin0 Apr 26 17:17db.sqlite-wal1Admin admin11K May 12 09:09.DS_Store-rwxrwxrwx+ 1 Admin admin219 Apr24 19:33•gitignore-rwxrwxrWx+1 Admin admin0 Apr1317:21screenpipe.db-rwxrwxrwx+1 Admin admin 8.4K May12 15:15screenpipe_fts_migrate.sh-rwxrwxrwx+ 1 Admin admin32K May 11 20:48screenpipe_sync.sh-rwxrwxrwx+ 1 Admin admin20K May 10 13:06screenpipe_sync_updated.shAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe$ cp archive.dbarchive.db.bak-pre-installidAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes ./screenpipe_fts_migrate.sh archive.dbScreenpipe FTS migrationDB:archive.dbSize: 13G• ×4-zsh• 285screenpipe"O 886ssh100% <78•Tue 12 May 15:50:3718187-zsh• *8+• Creating install registry_installs table• Om01s• Adding install_id to base tablesvideo_chunksalready presentError: stepping, UNIQUEconstraintfailed: video_chunks.install_id, video_chunks.id (19)Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT * FROM_installs;"Adm1neDXP4800PLUS-B5F8:/volume1/screenpipes sqlite3 archive.db "SELECT install_id, COUNT(*) FROM frames GROUP BY install_id;"Error: in prepare, no such column: install_idSELECT install_id,COUNT(*) FROM frames GROUP BY install_id;^_-- error hereAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipes |...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26640
|
1103
|
28
|
2026-05-12T12:50:37.411987+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590237411_m2.jpg...
|
Claude
|
Claude
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error
Last swimming outing with Dani
More options for Last swimming outing with Dani
Lukas Pro
Get apps and extensions
Screenpipe data sync and retention management, rename chat
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Close
Share chat
Claude finished the response
You said: Lets start from the beginning with the fresh mind.
You said: Lets start from the beginning with the fresh mind.
Pasted Text, pasted, 495 lines
#!/bin/bash # screenpipe_sync.sh # Syncs Screenpipe SQLite data to a NAS archive database (append-only, no deletions). # Also copies the day's video/frame data folder to the NAS. # # Schema-drift tolerant: if Screenpipe migrations add new columns to the source DB, # the NAS archive gets ALTER TABLE'
PASTED
Lets start from the beginning with the fresh mind. There is a script for screenpipe to copy data for day from mac to nas. There are two issues I want to work with. Firsts if I reinstall the mac version it starts from fresh id 1. That causes some issues. How to make sure the data are valid. I don't want some overcomplicated flow. I was thinking about making new db every 3 months. Secodn issue is that I wan to implement cleanup (retention policy) on mac original screenpipe db. I want script that will remove data that are 7 days old or older for example. ANd lastly I want to extedn the script to work with audio as well. What od you need
20:19
Retry
Edit
Copy
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Analyzed three technical challenges and identified clarifying questions needed...
|
[{"role":"AXLink","text":& [{"role":"AXLink","text":"Skip to content","depth":14,"bounds":{"left":0.50232714,"top":0.025538707,"width":0.0003324468,"height":0.0007980846},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Skip to content","depth":15,"bounds":{"left":0.50232714,"top":0.026336791,"width":0.030917553,"height":0.013567438},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.50232714,"top":0.027134877,"width":0.0026595744,"height":0.012769354}},{"char_start":1,"char_count":14,"bounds":{"left":0.5049867,"top":0.027134877,"width":0.02825798,"height":0.012769354}}],"role_description":"text"},{"role":"AXStaticText","text":"Click to collapse","depth":16,"bounds":{"left":0.6023936,"top":0.83719075,"width":0.030917553,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.6023936,"top":0.83719075,"width":0.0029920214,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.60538566,"top":0.83719075,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"⌘B","depth":16,"bounds":{"left":0.6349734,"top":0.83719075,"width":0.0066489363,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Drag to resize","depth":16,"bounds":{"left":0.6023936,"top":0.849162,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.6023936,"top":0.849162,"width":0.0029920214,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.60538566,"top":0.849162,"width":0.022938829,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Collapse sidebar","depth":15,"bounds":{"left":0.5305851,"top":0.02952913,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search","depth":15,"bounds":{"left":0.53856385,"top":0.02952913,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat","depth":16,"bounds":{"left":0.50598407,"top":0.06304868,"width":0.026263298,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cowork","depth":16,"bounds":{"left":0.53291225,"top":0.06304868,"width":0.031914894,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code","depth":16,"bounds":{"left":0.56515956,"top":0.06304868,"width":0.027260639,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New chat ⌘N","depth":15,"bounds":{"left":0.5053192,"top":0.096568234,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"New chat","depth":16,"bounds":{"left":0.5152925,"top":0.09976058,"width":0.019614361,"height":0.013567438},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.5152925,"top":0.10055866,"width":0.0033244682,"height":0.013567438}},{"char_start":1,"char_count":7,"bounds":{"left":0.51861703,"top":0.10055866,"width":0.015957447,"height":0.013567438}}],"role_description":"text"},{"role":"AXStaticText","text":"⌘N","depth":17,"bounds":{"left":0.5844415,"top":0.10055866,"width":0.0066489363,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Projects","depth":15,"bounds":{"left":0.5053192,"top":0.11731844,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Artifacts","depth":15,"bounds":{"left":0.5053192,"top":0.13806863,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Customize","depth":15,"bounds":{"left":0.5053192,"top":0.15881884,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Pinned","depth":16,"bounds":{"left":0.50731385,"top":0.19872306,"width":0.08510638,"height":0.012769354},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Bulgarian citizenship application process for EU residents","depth":18,"bounds":{"left":0.5053192,"top":0.21548285,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Bulgarian citizenship application process for EU residents","depth":19,"bounds":{"left":0.58577126,"top":0.21867518,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Dawarich location tracking project","depth":18,"bounds":{"left":0.5053192,"top":0.23703113,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Dawarich location tracking project","depth":19,"bounds":{"left":0.58577126,"top":0.24022347,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Recents","depth":16,"bounds":{"left":0.50731385,"top":0.26735833,"width":0.06482713,"height":0.012769354},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"View all","depth":16,"bounds":{"left":0.5731383,"top":0.26735833,"width":0.019281914,"height":0.012769354},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe data sync and retention management","depth":18,"bounds":{"left":0.5053192,"top":0.28411812,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe data sync and retention management","depth":19,"bounds":{"left":0.58577126,"top":0.28731045,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync script failing after recent migrations","depth":18,"bounds":{"left":0.5053192,"top":0.3056664,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync script failing after recent migrations","depth":19,"bounds":{"left":0.58577126,"top":0.30885875,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hubspot BadRequest headers debugging","depth":18,"bounds":{"left":0.5053192,"top":0.3272147,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Hubspot BadRequest headers debugging","depth":19,"bounds":{"left":0.58577126,"top":0.33040702,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Monthly expense tracking","depth":18,"bounds":{"left":0.5053192,"top":0.34876296,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Monthly expense tracking","depth":19,"bounds":{"left":0.58577126,"top":0.3519553,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Exporting transaction data from Notion to finance hub","depth":18,"bounds":{"left":0.5053192,"top":0.37031126,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Exporting transaction data from Notion to finance hub","depth":19,"bounds":{"left":0.58577126,"top":0.3735036,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 How much have I spent for groc…","depth":18,"bounds":{"left":0.5053192,"top":0.39185953,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 How much have I spent for groc…","depth":19,"bounds":{"left":0.58577126,"top":0.39505187,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"April 2026 spending by category","depth":18,"bounds":{"left":0.5053192,"top":0.41340783,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for April 2026 spending by category","depth":19,"bounds":{"left":0.58577126,"top":0.41660017,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code diff review","depth":18,"bounds":{"left":0.5053192,"top":0.4349561,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Code diff review","depth":19,"bounds":{"left":0.58577126,"top":0.43814844,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit implementation strategy","depth":18,"bounds":{"left":0.5053192,"top":0.45650437,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit implementation strategy","depth":19,"bounds":{"left":0.58577126,"top":0.45969674,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe retention policy code location","depth":18,"bounds":{"left":0.5053192,"top":0.47805268,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe retention policy code location","depth":19,"bounds":{"left":0.58577126,"top":0.481245,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Viewing retention policy in screenpipe","depth":18,"bounds":{"left":0.5053192,"top":0.49960095,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Viewing retention policy in screenpipe","depth":19,"bounds":{"left":0.58577126,"top":0.5027933,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Clean shot x video recording termination issue","depth":18,"bounds":{"left":0.5053192,"top":0.5211492,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Clean shot x video recording termination issue","depth":19,"bounds":{"left":0.58577126,"top":0.5243416,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit handling with executeRequest","depth":18,"bounds":{"left":0.5053192,"top":0.54269755,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit handling with executeRequest","depth":19,"bounds":{"left":0.58577126,"top":0.54588985,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Untitled","depth":18,"bounds":{"left":0.5053192,"top":0.5642458,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options","depth":19,"bounds":{"left":0.58577126,"top":0.5674381,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 Screen pipe. Is there ability…","depth":18,"bounds":{"left":0.5053192,"top":0.5857941,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 Screen pipe. Is there ability…","depth":19,"bounds":{"left":0.58577126,"top":0.58898646,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"SMB mount access inconsistency between Finder and iTerm","depth":18,"bounds":{"left":0.5053192,"top":0.60734236,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for SMB mount access inconsistency between Finder and iTerm","depth":19,"bounds":{"left":0.58577126,"top":0.6105347,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 What is the best switch I can…","depth":18,"bounds":{"left":0.5053192,"top":0.62889063,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 What is the best switch I can…","depth":19,"bounds":{"left":0.58577126,"top":0.632083,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Permission denied on screenpipe volume","depth":18,"bounds":{"left":0.5053192,"top":0.65043896,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Permission denied on screenpipe volume","depth":19,"bounds":{"left":0.58577126,"top":0.65363127,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync database attachment error","depth":18,"bounds":{"left":0.5053192,"top":0.67198724,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync database attachment error","depth":19,"bounds":{"left":0.58577126,"top":0.67517954,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Last swimming outing with Dani","depth":18,"bounds":{"left":0.5053192,"top":0.6935355,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Last swimming outing with Dani","depth":19,"bounds":{"left":0.58577126,"top":0.6967279,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"Lukas Pro","depth":15,"bounds":{"left":0.5053192,"top":0.9696728,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Get apps and extensions","depth":15,"bounds":{"left":0.5851064,"top":0.9696728,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe data sync and retention management, rename chat","depth":19,"bounds":{"left":0.6023936,"top":0.02793296,"width":0.11070479,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Screenpipe data sync and retention management","depth":21,"bounds":{"left":0.6037234,"top":0.031923383,"width":0.10804521,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.6037234,"top":0.031923383,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":44,"bounds":{"left":0.60671544,"top":0.031923383,"width":0.105053194,"height":0.014365523}}],"role_description":"text"},{"role":"AXPopUpButton","text":"More options for Screenpipe data sync and retention management","depth":19,"bounds":{"left":0.7134308,"top":0.02793296,"width":0.006981383,"height":0.022346368},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close","depth":21,"bounds":{"left":0.7702792,"top":0.026336791,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Share chat","depth":21,"bounds":{"left":0.78224736,"top":0.026336791,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Claude finished the response","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"You said: Lets start from the beginning with the fresh mind.","depth":20,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"You said: Lets start from the beginning with the fresh mind.","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Pasted Text, pasted, 495 lines","depth":21,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"#!/bin/bash # screenpipe_sync.sh # Syncs Screenpipe SQLite data to a NAS archive database (append-only, no deletions). # Also copies the day's video/frame data folder to the NAS. # # Schema-drift tolerant: if Screenpipe migrations add new columns to the source DB, # the NAS archive gets ALTER TABLE'","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PASTED","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Lets start from the beginning with the fresh mind. There is a script for screenpipe to copy data for day from mac to nas. There are two issues I want to work with. Firsts if I reinstall the mac version it starts from fresh id 1. That causes some issues. How to make sure the data are valid. I don't want some overcomplicated flow. I was thinking about making new db every 3 months. Secodn issue is that I wan to implement cleanup (retention policy) on mac original screenpipe db. I want script that will remove data that are 7 days old or older for example. ANd lastly I want to extedn the script to work with audio as well. What od you need","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"20:19","depth":22,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Retry","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Edit","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Copy","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…","depth":21,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…","depth":22,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Analyzed three technical challenges and identified clarifying questions needed","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6198050682720094651
|
1157389429984026133
|
app_switch
|
accessibility
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error
Last swimming outing with Dani
More options for Last swimming outing with Dani
Lukas Pro
Get apps and extensions
Screenpipe data sync and retention management, rename chat
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Close
Share chat
Claude finished the response
You said: Lets start from the beginning with the fresh mind.
You said: Lets start from the beginning with the fresh mind.
Pasted Text, pasted, 495 lines
#!/bin/bash # screenpipe_sync.sh # Syncs Screenpipe SQLite data to a NAS archive database (append-only, no deletions). # Also copies the day's video/frame data folder to the NAS. # # Schema-drift tolerant: if Screenpipe migrations add new columns to the source DB, # the NAS archive gets ALTER TABLE'
PASTED
Lets start from the beginning with the fresh mind. There is a script for screenpipe to copy data for day from mac to nas. There are two issues I want to work with. Firsts if I reinstall the mac version it starts from fresh id 1. That causes some issues. How to make sure the data are valid. I don't want some overcomplicated flow. I was thinking about making new db every 3 months. Secodn issue is that I wan to implement cleanup (retention policy) on mac original screenpipe db. I want script that will remove data that are 7 days old or older for example. ANd lastly I want to extedn the script to work with audio as well. What od you need
20:19
Retry
Edit
Copy
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Analyzed three technical challenges and identified clarifying questions needed...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26642
|
NULL
|
0
|
2026-05-12T12:50:38.694981+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590238694_m2.jpg...
|
Claude
|
Claude
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error
Last swimming outing with Dani
More options for Last swimming outing with Dani
Lukas Pro
Get apps and extensions
Screenpipe data sync and retention management, rename chat
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Close
Share chat
Claude finished the response
You said: Lets start from the beginning with the fresh mind.
You said: Lets start from the beginning with the fresh mind.
Pasted Text, pasted, 495 lines
#!/bin/bash # screenpipe_sync.sh # Syncs Screenpipe SQLite data to a NAS archive database (append-only, no deletions). # Also copies the day's video/frame data folder to the NAS. # # Schema-drift tolerant: if Screenpipe migrations add new columns to the source DB, # the NAS archive gets ALTER TABLE'
PASTED
Lets start from the beginning with the fresh mind. There is a script for screenpipe to copy data for day from mac to nas. There are two issues I want to work with. Firsts if I reinstall the mac version it starts from fresh id 1. That causes some issues. How to make sure the data are valid. I don't want some overcomplicated flow. I was thinking about making new db every 3 months. Secodn issue is that I wan to implement cleanup (retention policy) on mac original screenpipe db. I want script that will remove data that are 7 days old or older for example. ANd lastly I want to extedn the script to work with audio as well. What od you need
20:19
Retry
Edit
Copy
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Analyzed three technical challenges and identified clarifying questions needed
Analyzed three technical challenges and identified clarifying questions needed
Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether reinstalls have already happened). Before I touch the script, a few things:
Issue 1 — ID collisions / archive rotation
Has a reinstall already happened, or is the current
archive.db
still from one continuous install? If collisions already exist I need to handle that first; if not, we have a clean slate.
Quarterly rotation works, but it doesn't actually solve reinstalls
within
a quarter. A cleaner option that I'd lean toward: add an
install_id
column (UUID generated once and stored in a tiny
_meta
table in the source DB) to every synced table, and make
(install_id, id)
the logical key. FK joins just gain one extra predicate. Reinstall → new install_id → no collisions, ever. You can still rotate the archive DB quarterly for file-size reasons, but it's no longer load-bearing.
Do you ever run cross-period queries (e.g. "every frame mentioning JY-20458 across all time")? That answers whether quarterly sharding is acceptable or whether one growing DB is better.
Issue 2 — Mac-side retention
Your launch command already has
--retention-days 7
. Is that not actually deleting anything, or do you want a separate scripted retention you can trust/observe independently?
Should retention also wipe the matching
~/.screenpipe/data/data/YYYY-MM-DD/
folders, or only DB rows? (CLI flag does both I believe; a script should match.)
Run order matters: sync writes
yesterday
, retention deletes
>7 days old
— no overlap, but I'd still chain them (sync → retention → log) in one cron entry so a failed sync blocks the delete. OK with that?
Issue 3 — Audio
Your current launch flag is
--disable-audio
, so right now there's no audio data to sync. Are you planning to enable it, or is this just to future-proof the script?
I need the audio schema. Could you run this and paste the output:
Copy to clipboard
sqlite3 ~/.screenpipe/db.sqlite ".schema" | grep -iE -A 20 "audio|transcription"
And:
ls ~/.screenpipe/data/data/$(date -v-1d +%Y-%m-%d)/ | head
so I can see what audio files look like on disk alongside the mp4 frames.
Once I have those, I'll restructure the script in one go rather than piecemeal.
Copy
Give positive feedback
Give negative feedback
Retry
You said: ok lets add install_id.
You said: ok lets add install_id.
Pasted Text, pasted, 208 lines
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ sqlite3 ~/.screenpipe/db.sqlite ".schema" | grep -iE -A 20 "audio|transcription" CREATE TABLE audio_chunks ( id INTEGER PRIMARY KEY AUTOINCREMENT, file_path TEXT NOT NULL , timestamp TIMESTAMP, sync_id TEXT, machine_id TEXT, synced_at DATETIME, ev
PASTED
ok lets add install_id. Lets add separate script deleting data again from data and it should also remove logs and data. Make it manual script for now. I will remove --disable-audio from alias and run it without. I wan to have audio as well. lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ ls ~/.screenpipe/data/data/$(date -v-1d +%Y-%m-%d)/ | head
compact_monitor_1_1778411210025.mp4
compact_monitor_1_1778413422547.mp4
compact_monitor_1_1778436664801.mp4
compact_monitor_1_1778437267451.mp4
compact_monitor_1_1778437569681.mp4
compact_monitor_1_1778437873507.mp4
compact_monitor_1_1778438175846.mp4
compact_monitor_1_1778438477299.mp4
compact_monitor_1_1778438780686.mp4
compact_monitor_1_1778439082442.mp4 Inside ~/,screenpipe/data there are data like this ... -rw-r--r-- 1 lukas staff 4628 11 May 16:48 System Audio (output)_2026-05-11_13-48-12.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:48 System Audio (output)_2026-05-11_13-48-34.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:49 System Audio (output)_2026-05-11_13-48-56.mp4
-rw-r--r-- 1 lukas staff 4628 11 May 16:49 System Audio (output)_2026-05-11_13-49-19.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:50 System Audio (output)_2026-05-11_13-49-41.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:50 System Audio (output)_2026-05-11_13-50-03.mp4
-rw-r--r-- 1 lukas staff 4628 11 May 16:50 System Audio (output)_2026-05-11_13-50-26.mp4
-rw-r--r-- 1 lukas staff 4628 11 May 16:51 System Audio (output)_2026-05-11_13-50-48.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:51 System Audio (output)_2026-05-11_13-51-10.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:51 System Audio (output)_2026-05-11_13-51-33.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:52 System Audio (output)_2026-05-11_13-51-55.mp4
drwxr-xr-x 9 lukas staff 288 11 May 07:54 data
drwxr-xr-x 2 lukas staff 64 11 May 15:48 pending-transcriptions
-rw-r--r-- 1 lukas staff 29419 10 May 14:11 soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
-rw-r--r-- 1 lukas staff 56479 10 May 14:11 soundcore AeroClip (input)_2026-05-10_11-11-05.mp4
-rw-r--r--@ 1 lukas staff 181831 10 May 14:12 soundcore AeroClip (input)_2026-05-10_11-11-35.mp4
-rw-r--r-- 1 lukas staff 149782 10 May 14:43 soundcore AeroClip (input)_2026-05-10_11-42-53.mp4
-rw-r--r-- 1 lukas staff 91059 10 May 14:43 soundcore AeroClip (input)_2026-05-10_11-43-25.mp4
-rw-r--r-- 1 lukas staff 30604 10 May 14:44 soundcore AeroClip (input)_2026-05-10_11-44-25.mp4
-rw-r--r-- 1 lukas staff 93813 10 May 14:45 soundcore AeroClip (input)_2026-05-10_11-44-55.mp4
-rw-r--r-- 1 lukas staff 40444 10 May 21:11 soundcore AeroClip (input)_2026-05-10_18-11-18.mp4
-rw-r--r-- 1 lukas staff 193020 10 May 21:12 soundcore AeroClip (input)_2026-05-10_18-11-48.mp4...
Show more
20:34
Retry
Edit...
|
[{"role":"AXLink","text":& [{"role":"AXLink","text":"Skip to content","depth":14,"bounds":{"left":0.50232714,"top":0.025538707,"width":0.0003324468,"height":0.0007980846},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Skip to content","depth":15,"bounds":{"left":0.50232714,"top":0.026336791,"width":0.030917553,"height":0.013567438},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.50232714,"top":0.027134877,"width":0.0026595744,"height":0.012769354}},{"char_start":1,"char_count":14,"bounds":{"left":0.5049867,"top":0.027134877,"width":0.02825798,"height":0.012769354}}],"role_description":"text"},{"role":"AXStaticText","text":"Click to collapse","depth":16,"bounds":{"left":0.6023936,"top":0.83719075,"width":0.030917553,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.6023936,"top":0.83719075,"width":0.0029920214,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.60538566,"top":0.83719075,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"⌘B","depth":16,"bounds":{"left":0.6349734,"top":0.83719075,"width":0.0066489363,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Drag to resize","depth":16,"bounds":{"left":0.6023936,"top":0.849162,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.6023936,"top":0.849162,"width":0.0029920214,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.60538566,"top":0.849162,"width":0.022938829,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Collapse sidebar","depth":15,"bounds":{"left":0.5305851,"top":0.02952913,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search","depth":15,"bounds":{"left":0.53856385,"top":0.02952913,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat","depth":16,"bounds":{"left":0.50598407,"top":0.06304868,"width":0.026263298,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cowork","depth":16,"bounds":{"left":0.53291225,"top":0.06304868,"width":0.031914894,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code","depth":16,"bounds":{"left":0.56515956,"top":0.06304868,"width":0.027260639,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New chat ⌘N","depth":15,"bounds":{"left":0.5053192,"top":0.096568234,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"New chat","depth":16,"bounds":{"left":0.5152925,"top":0.09976058,"width":0.019614361,"height":0.013567438},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.5152925,"top":0.10055866,"width":0.0033244682,"height":0.013567438}},{"char_start":1,"char_count":7,"bounds":{"left":0.51861703,"top":0.10055866,"width":0.015957447,"height":0.013567438}}],"role_description":"text"},{"role":"AXStaticText","text":"⌘N","depth":17,"bounds":{"left":0.5844415,"top":0.10055866,"width":0.0066489363,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Projects","depth":15,"bounds":{"left":0.5053192,"top":0.11731844,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Artifacts","depth":15,"bounds":{"left":0.5053192,"top":0.13806863,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Customize","depth":15,"bounds":{"left":0.5053192,"top":0.15881884,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Pinned","depth":16,"bounds":{"left":0.50731385,"top":0.19872306,"width":0.08510638,"height":0.012769354},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"Bulgarian citizenship application process for EU residents","depth":18,"bounds":{"left":0.5053192,"top":0.21548285,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Bulgarian citizenship application process for EU residents","depth":19,"bounds":{"left":0.58577126,"top":0.21867518,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Dawarich location tracking project","depth":18,"bounds":{"left":0.5053192,"top":0.23703113,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Dawarich location tracking project","depth":19,"bounds":{"left":0.58577126,"top":0.24022347,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Recents","depth":16,"bounds":{"left":0.50731385,"top":0.26735833,"width":0.06482713,"height":0.012769354},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXButton","text":"View all","depth":16,"bounds":{"left":0.5731383,"top":0.26735833,"width":0.019281914,"height":0.012769354},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe data sync and retention management","depth":18,"bounds":{"left":0.5053192,"top":0.28411812,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe data sync and retention management","depth":19,"bounds":{"left":0.58577126,"top":0.28731045,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync script failing after recent migrations","depth":18,"bounds":{"left":0.5053192,"top":0.3056664,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync script failing after recent migrations","depth":19,"bounds":{"left":0.58577126,"top":0.30885875,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hubspot BadRequest headers debugging","depth":18,"bounds":{"left":0.5053192,"top":0.3272147,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Hubspot BadRequest headers debugging","depth":19,"bounds":{"left":0.58577126,"top":0.33040702,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Monthly expense tracking","depth":18,"bounds":{"left":0.5053192,"top":0.34876296,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Monthly expense tracking","depth":19,"bounds":{"left":0.58577126,"top":0.3519553,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Exporting transaction data from Notion to finance hub","depth":18,"bounds":{"left":0.5053192,"top":0.37031126,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Exporting transaction data from Notion to finance hub","depth":19,"bounds":{"left":0.58577126,"top":0.3735036,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 How much have I spent for groc…","depth":18,"bounds":{"left":0.5053192,"top":0.39185953,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 How much have I spent for groc…","depth":19,"bounds":{"left":0.58577126,"top":0.39505187,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"April 2026 spending by category","depth":18,"bounds":{"left":0.5053192,"top":0.41340783,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for April 2026 spending by category","depth":19,"bounds":{"left":0.58577126,"top":0.41660017,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code diff review","depth":18,"bounds":{"left":0.5053192,"top":0.4349561,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Code diff review","depth":19,"bounds":{"left":0.58577126,"top":0.43814844,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit implementation strategy","depth":18,"bounds":{"left":0.5053192,"top":0.45650437,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit implementation strategy","depth":19,"bounds":{"left":0.58577126,"top":0.45969674,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe retention policy code location","depth":18,"bounds":{"left":0.5053192,"top":0.47805268,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe retention policy code location","depth":19,"bounds":{"left":0.58577126,"top":0.481245,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Viewing retention policy in screenpipe","depth":18,"bounds":{"left":0.5053192,"top":0.49960095,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Viewing retention policy in screenpipe","depth":19,"bounds":{"left":0.58577126,"top":0.5027933,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Clean shot x video recording termination issue","depth":18,"bounds":{"left":0.5053192,"top":0.5211492,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Clean shot x video recording termination issue","depth":19,"bounds":{"left":0.58577126,"top":0.5243416,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"HubSpot rate limit handling with executeRequest","depth":18,"bounds":{"left":0.5053192,"top":0.54269755,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for HubSpot rate limit handling with executeRequest","depth":19,"bounds":{"left":0.58577126,"top":0.54588985,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Untitled","depth":18,"bounds":{"left":0.5053192,"top":0.5642458,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options","depth":19,"bounds":{"left":0.58577126,"top":0.5674381,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 Screen pipe. Is there ability…","depth":18,"bounds":{"left":0.5053192,"top":0.5857941,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 Screen pipe. Is there ability…","depth":19,"bounds":{"left":0.58577126,"top":0.58898646,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"SMB mount access inconsistency between Finder and iTerm","depth":18,"bounds":{"left":0.5053192,"top":0.60734236,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for SMB mount access inconsistency between Finder and iTerm","depth":19,"bounds":{"left":0.58577126,"top":0.6105347,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"💬 What is the best switch I can…","depth":18,"bounds":{"left":0.5053192,"top":0.62889063,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for 💬 What is the best switch I can…","depth":19,"bounds":{"left":0.58577126,"top":0.632083,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Permission denied on screenpipe volume","depth":18,"bounds":{"left":0.5053192,"top":0.65043896,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Permission denied on screenpipe volume","depth":19,"bounds":{"left":0.58577126,"top":0.65363127,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe sync database attachment error","depth":18,"bounds":{"left":0.5053192,"top":0.67198724,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Screenpipe sync database attachment error","depth":19,"bounds":{"left":0.58577126,"top":0.67517954,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Last swimming outing with Dani","depth":18,"bounds":{"left":0.5053192,"top":0.6935355,"width":0.087765954,"height":0.0207502},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"More options for Last swimming outing with Dani","depth":19,"bounds":{"left":0.58577126,"top":0.6967279,"width":0.005984043,"height":0.014365523},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXPopUpButton","text":"Lukas Pro","depth":15,"bounds":{"left":0.5053192,"top":0.9696728,"width":0.03856383,"height":0.01915403},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Get apps and extensions","depth":15,"bounds":{"left":0.5851064,"top":0.9696728,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Screenpipe data sync and retention management, rename chat","depth":19,"bounds":{"left":0.6023936,"top":0.02793296,"width":0.11070479,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Screenpipe data sync and retention management","depth":21,"bounds":{"left":0.6037234,"top":0.031923383,"width":0.10804521,"height":0.014365523},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.6037234,"top":0.031923383,"width":0.0029920214,"height":0.014365523}},{"char_start":1,"char_count":44,"bounds":{"left":0.60671544,"top":0.031923383,"width":0.105053194,"height":0.014365523}}],"role_description":"text"},{"role":"AXPopUpButton","text":"More options for Screenpipe data sync and retention management","depth":19,"bounds":{"left":0.7134308,"top":0.02793296,"width":0.006981383,"height":0.022346368},"on_screen":true,"role_description":"pop-up button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Close","depth":21,"bounds":{"left":0.7702792,"top":0.026336791,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Share chat","depth":21,"bounds":{"left":0.78224736,"top":0.026336791,"width":0.010638298,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Claude finished the response","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"You said: Lets start from the beginning with the fresh mind.","depth":20,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"You said: Lets start from the beginning with the fresh mind.","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Pasted Text, pasted, 495 lines","depth":21,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"#!/bin/bash # screenpipe_sync.sh # Syncs Screenpipe SQLite data to a NAS archive database (append-only, no deletions). # Also copies the day's video/frame data folder to the NAS. # # Schema-drift tolerant: if Screenpipe migrations add new columns to the source DB, # the NAS archive gets ALTER TABLE'","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PASTED","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Lets start from the beginning with the fresh mind. There is a script for screenpipe to copy data for day from mac to nas. There are two issues I want to work with. Firsts if I reinstall the mac version it starts from fresh id 1. That causes some issues. How to make sure the data are valid. I don't want some overcomplicated flow. I was thinking about making new db every 3 months. Secodn issue is that I wan to implement cleanup (retention policy) on mac original screenpipe db. I want script that will remove data that are 7 days old or older for example. ANd lastly I want to extedn the script to work with audio as well. What od you need","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"20:19","depth":22,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Retry","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Edit","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Copy","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…","depth":21,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…","depth":22,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Analyzed three technical challenges and identified clarifying questions needed","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzed three technical challenges and identified clarifying questions needed","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether reinstalls have already happened). Before I touch the script, a few things:","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Issue 1 — ID collisions / archive rotation","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Has a reinstall already happened, or is the current","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"still from one continuous install? If collisions already exist I need to handle that first; if not, we have a clean slate.","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Quarterly rotation works, but it doesn't actually solve reinstalls","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"within","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"a quarter. A cleaner option that I'd lean toward: add an","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"install_id","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"column (UUID generated once and stored in a tiny","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_meta","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"table in the source DB) to every synced table, and make","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(install_id, id)","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"the logical key. FK joins just gain one extra predicate. Reinstall → new install_id → no collisions, ever. You can still rotate the archive DB quarterly for file-size reasons, but it's no longer load-bearing.","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Do you ever run cross-period queries (e.g. \"every frame mentioning JY-20458 across all time\")? That answers whether quarterly sharding is acceptable or whether one growing DB is better.","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Issue 2 — Mac-side retention","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Your launch command already has","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"--retention-days 7","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Is that not actually deleting anything, or do you want a separate scripted retention you can trust/observe independently?","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Should retention also wipe the matching","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"~/.screenpipe/data/data/YYYY-MM-DD/","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"folders, or only DB rows? (CLI flag does both I believe; a script should match.)","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Run order matters: sync writes","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"yesterday","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", retention deletes","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":">7 days old","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— no overlap, but I'd still chain them (sync → retention → log) in one cron entry so a failed sync blocks the delete. OK with that?","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Issue 3 — Audio","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Your current launch flag is","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"--disable-audio","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", so right now there's no audio data to sync. Are you planning to enable it, or is this just to future-proof the script?","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I need the audio schema. Could you run this and paste the output:","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy to clipboard","depth":27,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"sqlite3 ~/.screenpipe/db.sqlite \".schema\" | grep -iE -A 20 \"audio|transcription\"","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"And:","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls ~/.screenpipe/data/data/$(date -v-1d +%Y-%m-%d)/ | head","depth":27,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"so I can see what audio files look like on disk alongside the mp4 frames.","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Once I have those, I'll restructure the script in one go rather than piecemeal.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Give positive feedback","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Give negative feedback","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Retry","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"You said: ok lets add install_id.","depth":20,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"You said: ok lets add install_id.","depth":21,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Pasted Text, pasted, 208 lines","depth":21,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ sqlite3 ~/.screenpipe/db.sqlite \".schema\" | grep -iE -A 20 \"audio|transcription\" CREATE TABLE audio_chunks ( id INTEGER PRIMARY KEY AUTOINCREMENT, file_path TEXT NOT NULL , timestamp TIMESTAMP, sync_id TEXT, machine_id TEXT, synced_at DATETIME, ev","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PASTED","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ok lets add install_id. Lets add separate script deleting data again from data and it should also remove logs and data. Make it manual script for now. I will remove --disable-audio from alias and run it without. I wan to have audio as well. lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ ls ~/.screenpipe/data/data/$(date -v-1d +%Y-%m-%d)/ | head\ncompact_monitor_1_1778411210025.mp4\ncompact_monitor_1_1778413422547.mp4\ncompact_monitor_1_1778436664801.mp4\ncompact_monitor_1_1778437267451.mp4\ncompact_monitor_1_1778437569681.mp4\ncompact_monitor_1_1778437873507.mp4\ncompact_monitor_1_1778438175846.mp4\ncompact_monitor_1_1778438477299.mp4\ncompact_monitor_1_1778438780686.mp4\ncompact_monitor_1_1778439082442.mp4 Inside ~/,screenpipe/data there are data like this ... -rw-r--r-- 1 lukas staff 4628 11 May 16:48 System Audio (output)_2026-05-11_13-48-12.mp4\n-rw-r--r-- 1 lukas staff 4620 11 May 16:48 System Audio (output)_2026-05-11_13-48-34.mp4\n-rw-r--r-- 1 lukas staff 4620 11 May 16:49 System Audio (output)_2026-05-11_13-48-56.mp4\n-rw-r--r-- 1 lukas staff 4628 11 May 16:49 System Audio (output)_2026-05-11_13-49-19.mp4\n-rw-r--r-- 1 lukas staff 4620 11 May 16:50 System Audio (output)_2026-05-11_13-49-41.mp4\n-rw-r--r-- 1 lukas staff 4620 11 May 16:50 System Audio (output)_2026-05-11_13-50-03.mp4\n-rw-r--r-- 1 lukas staff 4628 11 May 16:50 System Audio (output)_2026-05-11_13-50-26.mp4\n-rw-r--r-- 1 lukas staff 4628 11 May 16:51 System Audio (output)_2026-05-11_13-50-48.mp4\n-rw-r--r-- 1 lukas staff 4620 11 May 16:51 System Audio (output)_2026-05-11_13-51-10.mp4\n-rw-r--r-- 1 lukas staff 4620 11 May 16:51 System Audio (output)_2026-05-11_13-51-33.mp4\n-rw-r--r-- 1 lukas staff 4620 11 May 16:52 System Audio (output)_2026-05-11_13-51-55.mp4\ndrwxr-xr-x 9 lukas staff 288 11 May 07:54 data\ndrwxr-xr-x 2 lukas staff 64 11 May 15:48 pending-transcriptions\n-rw-r--r-- 1 lukas staff 29419 10 May 14:11 soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n-rw-r--r-- 1 lukas staff 56479 10 May 14:11 soundcore AeroClip (input)_2026-05-10_11-11-05.mp4\n-rw-r--r--@ 1 lukas staff 181831 10 May 14:12 soundcore AeroClip (input)_2026-05-10_11-11-35.mp4\n-rw-r--r-- 1 lukas staff 149782 10 May 14:43 soundcore AeroClip (input)_2026-05-10_11-42-53.mp4\n-rw-r--r-- 1 lukas staff 91059 10 May 14:43 soundcore AeroClip (input)_2026-05-10_11-43-25.mp4\n-rw-r--r-- 1 lukas staff 30604 10 May 14:44 soundcore AeroClip (input)_2026-05-10_11-44-25.mp4\n-rw-r--r-- 1 lukas staff 93813 10 May 14:45 soundcore AeroClip (input)_2026-05-10_11-44-55.mp4\n-rw-r--r-- 1 lukas staff 40444 10 May 21:11 soundcore AeroClip (input)_2026-05-10_18-11-18.mp4\n-rw-r--r-- 1 lukas staff 193020 10 May 21:12 soundcore AeroClip (input)_2026-05-10_18-11-48.mp4...","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Show more","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"20:34","depth":22,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Retry","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Edit","depth":22,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4808048580765336972
|
-8498680011010867631
|
visual_change
|
accessibility
|
NULL
|
Skip to content
Skip to content
Click to collapse
Skip to content
Skip to content
Click to collapse
⌘B
Drag to resize
Collapse sidebar
Search
Chat
Cowork
Code
New chat ⌘N
New chat
⌘N
Projects
Artifacts
Customize
Pinned
Bulgarian citizenship application process for EU residents
More options for Bulgarian citizenship application process for EU residents
Dawarich location tracking project
More options for Dawarich location tracking project
Recents
View all
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Screenpipe sync script failing after recent migrations
More options for Screenpipe sync script failing after recent migrations
Hubspot BadRequest headers debugging
More options for Hubspot BadRequest headers debugging
Monthly expense tracking
More options for Monthly expense tracking
Exporting transaction data from Notion to finance hub
More options for Exporting transaction data from Notion to finance hub
💬 How much have I spent for groc…
More options for 💬 How much have I spent for groc…
April 2026 spending by category
More options for April 2026 spending by category
Code diff review
More options for Code diff review
HubSpot rate limit implementation strategy
More options for HubSpot rate limit implementation strategy
Screenpipe retention policy code location
More options for Screenpipe retention policy code location
Viewing retention policy in screenpipe
More options for Viewing retention policy in screenpipe
Clean shot x video recording termination issue
More options for Clean shot x video recording termination issue
HubSpot rate limit handling with executeRequest
More options for HubSpot rate limit handling with executeRequest
Untitled
More options
💬 Screen pipe. Is there ability…
More options for 💬 Screen pipe. Is there ability…
SMB mount access inconsistency between Finder and iTerm
More options for SMB mount access inconsistency between Finder and iTerm
💬 What is the best switch I can…
More options for 💬 What is the best switch I can…
Permission denied on screenpipe volume
More options for Permission denied on screenpipe volume
Screenpipe sync database attachment error
More options for Screenpipe sync database attachment error
Last swimming outing with Dani
More options for Last swimming outing with Dani
Lukas Pro
Get apps and extensions
Screenpipe data sync and retention management, rename chat
Screenpipe data sync and retention management
More options for Screenpipe data sync and retention management
Close
Share chat
Claude finished the response
You said: Lets start from the beginning with the fresh mind.
You said: Lets start from the beginning with the fresh mind.
Pasted Text, pasted, 495 lines
#!/bin/bash # screenpipe_sync.sh # Syncs Screenpipe SQLite data to a NAS archive database (append-only, no deletions). # Also copies the day's video/frame data folder to the NAS. # # Schema-drift tolerant: if Screenpipe migrations add new columns to the source DB, # the NAS archive gets ALTER TABLE'
PASTED
Lets start from the beginning with the fresh mind. There is a script for screenpipe to copy data for day from mac to nas. There are two issues I want to work with. Firsts if I reinstall the mac version it starts from fresh id 1. That causes some issues. How to make sure the data are valid. I don't want some overcomplicated flow. I was thinking about making new db every 3 months. Secodn issue is that I wan to implement cleanup (retention policy) on mac original screenpipe db. I want script that will remove data that are 7 days old or older for example. ANd lastly I want to extedn the script to work with audio as well. What od you need
20:19
Retry
Edit
Copy
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Claude responded: Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether…
Analyzed three technical challenges and identified clarifying questions needed
Analyzed three technical challenges and identified clarifying questions needed
Good plan to tackle these together — they interact (retention timing depends on sync timing, audio sync depends on schema shape, ID strategy depends on whether reinstalls have already happened). Before I touch the script, a few things:
Issue 1 — ID collisions / archive rotation
Has a reinstall already happened, or is the current
archive.db
still from one continuous install? If collisions already exist I need to handle that first; if not, we have a clean slate.
Quarterly rotation works, but it doesn't actually solve reinstalls
within
a quarter. A cleaner option that I'd lean toward: add an
install_id
column (UUID generated once and stored in a tiny
_meta
table in the source DB) to every synced table, and make
(install_id, id)
the logical key. FK joins just gain one extra predicate. Reinstall → new install_id → no collisions, ever. You can still rotate the archive DB quarterly for file-size reasons, but it's no longer load-bearing.
Do you ever run cross-period queries (e.g. "every frame mentioning JY-20458 across all time")? That answers whether quarterly sharding is acceptable or whether one growing DB is better.
Issue 2 — Mac-side retention
Your launch command already has
--retention-days 7
. Is that not actually deleting anything, or do you want a separate scripted retention you can trust/observe independently?
Should retention also wipe the matching
~/.screenpipe/data/data/YYYY-MM-DD/
folders, or only DB rows? (CLI flag does both I believe; a script should match.)
Run order matters: sync writes
yesterday
, retention deletes
>7 days old
— no overlap, but I'd still chain them (sync → retention → log) in one cron entry so a failed sync blocks the delete. OK with that?
Issue 3 — Audio
Your current launch flag is
--disable-audio
, so right now there's no audio data to sync. Are you planning to enable it, or is this just to future-proof the script?
I need the audio schema. Could you run this and paste the output:
Copy to clipboard
sqlite3 ~/.screenpipe/db.sqlite ".schema" | grep -iE -A 20 "audio|transcription"
And:
ls ~/.screenpipe/data/data/$(date -v-1d +%Y-%m-%d)/ | head
so I can see what audio files look like on disk alongside the mp4 frames.
Once I have those, I'll restructure the script in one go rather than piecemeal.
Copy
Give positive feedback
Give negative feedback
Retry
You said: ok lets add install_id.
You said: ok lets add install_id.
Pasted Text, pasted, 208 lines
lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ sqlite3 ~/.screenpipe/db.sqlite ".schema" | grep -iE -A 20 "audio|transcription" CREATE TABLE audio_chunks ( id INTEGER PRIMARY KEY AUTOINCREMENT, file_path TEXT NOT NULL , timestamp TIMESTAMP, sync_id TEXT, machine_id TEXT, synced_at DATETIME, ev
PASTED
ok lets add install_id. Lets add separate script deleting data again from data and it should also remove logs and data. Make it manual script for now. I will remove --disable-audio from alias and run it without. I wan to have audio as well. lukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ ls ~/.screenpipe/data/data/$(date -v-1d +%Y-%m-%d)/ | head
compact_monitor_1_1778411210025.mp4
compact_monitor_1_1778413422547.mp4
compact_monitor_1_1778436664801.mp4
compact_monitor_1_1778437267451.mp4
compact_monitor_1_1778437569681.mp4
compact_monitor_1_1778437873507.mp4
compact_monitor_1_1778438175846.mp4
compact_monitor_1_1778438477299.mp4
compact_monitor_1_1778438780686.mp4
compact_monitor_1_1778439082442.mp4 Inside ~/,screenpipe/data there are data like this ... -rw-r--r-- 1 lukas staff 4628 11 May 16:48 System Audio (output)_2026-05-11_13-48-12.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:48 System Audio (output)_2026-05-11_13-48-34.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:49 System Audio (output)_2026-05-11_13-48-56.mp4
-rw-r--r-- 1 lukas staff 4628 11 May 16:49 System Audio (output)_2026-05-11_13-49-19.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:50 System Audio (output)_2026-05-11_13-49-41.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:50 System Audio (output)_2026-05-11_13-50-03.mp4
-rw-r--r-- 1 lukas staff 4628 11 May 16:50 System Audio (output)_2026-05-11_13-50-26.mp4
-rw-r--r-- 1 lukas staff 4628 11 May 16:51 System Audio (output)_2026-05-11_13-50-48.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:51 System Audio (output)_2026-05-11_13-51-10.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:51 System Audio (output)_2026-05-11_13-51-33.mp4
-rw-r--r-- 1 lukas staff 4620 11 May 16:52 System Audio (output)_2026-05-11_13-51-55.mp4
drwxr-xr-x 9 lukas staff 288 11 May 07:54 data
drwxr-xr-x 2 lukas staff 64 11 May 15:48 pending-transcriptions
-rw-r--r-- 1 lukas staff 29419 10 May 14:11 soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
-rw-r--r-- 1 lukas staff 56479 10 May 14:11 soundcore AeroClip (input)_2026-05-10_11-11-05.mp4
-rw-r--r--@ 1 lukas staff 181831 10 May 14:12 soundcore AeroClip (input)_2026-05-10_11-11-35.mp4
-rw-r--r-- 1 lukas staff 149782 10 May 14:43 soundcore AeroClip (input)_2026-05-10_11-42-53.mp4
-rw-r--r-- 1 lukas staff 91059 10 May 14:43 soundcore AeroClip (input)_2026-05-10_11-43-25.mp4
-rw-r--r-- 1 lukas staff 30604 10 May 14:44 soundcore AeroClip (input)_2026-05-10_11-44-25.mp4
-rw-r--r-- 1 lukas staff 93813 10 May 14:45 soundcore AeroClip (input)_2026-05-10_11-44-55.mp4
-rw-r--r-- 1 lukas staff 40444 10 May 21:11 soundcore AeroClip (input)_2026-05-10_18-11-18.mp4
-rw-r--r-- 1 lukas staff 193020 10 May 21:12 soundcore AeroClip (input)_2026-05-10_18-11-48.mp4...
Show more
20:34
Retry
Edit...
|
26640
|
NULL
|
NULL
|
NULL
|
|
26643
|
NULL
|
0
|
2026-05-12T12:50:43.762831+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590243762_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"on_screen":true,"role_description":"text"}]...
|
-5983120131412662505
|
3474621284938319765
|
app_switch
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26644
|
1105
|
0
|
2026-05-12T12:50:44.730558+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590244730_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5237734055032025378
|
3492635546011010965
|
visual_change
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26645
|
1104
|
0
|
2026-05-12T12:51:13.962694+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590273962_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
26643
|
NULL
|
NULL
|
NULL
|
|
26646
|
1105
|
1
|
2026-05-12T12:51:15.133989+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590275133_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.10853951,"width":0.0066489363,"height":0.0007980846},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"bounds":{"left":0.5674867,"top":0.10853951,"width":0.09275266,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Exit code 1\npermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?filters=%7B%22name%22%3A%7B%22screenpipe%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I don't have Docker socket access, so you'll need to run these yourself. Here are your options:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option A — via Docker (if container is already running):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
26644
|
NULL
|
NULL
|
NULL
|
|
26647
|
1104
|
1
|
2026-05-12T12:51:44.295283+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590304295_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
26648
|
1105
|
2
|
2026-05-12T12:51:45.501654+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590305501_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
26644
|
NULL
|
NULL
|
NULL
|
|
26649
|
1104
|
2
|
2026-05-12T12:52:14.627570+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590334627_m1.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Exit code 1\npermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?filters=%7B%22name%22%3A%7B%22screenpipe%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I don't have Docker socket access, so you'll need to run these yourself. Here are your options:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option A — via Docker (if container is already running):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List available pipes\ndocker exec -it screenpipe-app python cli.py pipe --list\n\n# Run a specific pipe\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option B — rebuild first (since we added new files), then run:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option C — via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(if container is up on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST http://localhost:8766/api/pipes/day-recap/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"day-recap","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"or","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"standup-update","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes are the best ones to test first since they use all data sources. Which option works for you?","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"how ot run for specifiday","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Docker exec:","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-25\n# or shortcuts:\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date yesterday\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date today","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"API:","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"curl -X POST \"http://localhost:8766/api/pipes/day-recap/run?d=2026-04-25\"","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CaSoR75WgV8fTcHTYJMDY'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"The container started before you updated the","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":", so it's using the old placeholder key. Restart it to pick up the new one:","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\nsudo docker compose restart screenpipe-app","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Then try again:","depth":23,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20","depth":25,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CaSoaWfbMTbPTbw5PpBu1'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"on_screen":true,"role_description":"text"}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
26647
|
NULL
|
NULL
|
NULL
|
|
26650
|
1105
|
3
|
2026-05-12T12:52:15.871276+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-12/1778 /Users/lukas/.screenpipe/data/data/2026-05-12/1778590335871_m2.jpg...
|
Code
|
screenpipe_sync.sh — screenpipe [SSH: nas] — Modif screenpipe_sync.sh — screenpipe [SSH: nas] — Modified...
|
True
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Explorer (⇧⌘E) - 1 unsaved file","depth":19,"bounds":{"left":0.0003324468,"top":0.047885075,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":true},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.057462092,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":22,"bounds":{"left":0.009973404,"top":0.06863528,"width":0.0016622341,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Search (⇧⌘F)","depth":19,"bounds":{"left":0.0003324468,"top":0.08619314,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.09577015,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Source Control (⌃⇧G) - 11 pending changes","depth":19,"bounds":{"left":0.0003324468,"top":0.1245012,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.13407822,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"11","depth":22,"bounds":{"left":0.008976064,"top":0.1452514,"width":0.0033244682,"height":0.008778931},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.00930851,"top":0.14604948,"width":0.0016622341,"height":0.007980846}},{"char_start":1,"char_count":1,"bounds":{"left":0.010638298,"top":0.14604948,"width":0.0019946808,"height":0.007980846}}],"role_description":"text"},{"role":"AXRadioButton","text":"Run and Debug (⇧⌘D)","depth":19,"bounds":{"left":0.0003324468,"top":0.16280925,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.17238627,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Remote Explorer","depth":19,"bounds":{"left":0.0003324468,"top":0.20111732,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.21069433,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Extensions (⇧⌘X) - 2 require update, 1 requires restart","depth":19,"bounds":{"left":0.0003324468,"top":0.23942538,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":22,"bounds":{"left":0.0043218085,"top":0.2490024,"width":0.007978723,"height":0.01915403},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":22,"bounds":{"left":0.009640957,"top":0.2601756,"width":0.0023271276,"height":0.008778931},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Claude Code","depth":19,"bounds":{"left":0.0003324468,"top":0.27773345,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"Containers","depth":19,"bounds":{"left":0.0003324468,"top":0.3160415,"width":0.015957447,"height":0.03830806},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXHeading","text":"EXPLORER","depth":17,"bounds":{"left":0.022938829,"top":0.047885075,"width":0.018949468,"height":0.02793296},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"EXPLORER","depth":18,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.018949468,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.056664005,"width":0.0023271276,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025265958,"top":0.056664005,"width":0.01662234,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Explorer Section: screenpipe [SSH: nas]","depth":21,"bounds":{"left":0.016289894,"top":0.07581804,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":true},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.07821229,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"Explorer Section: screenpipe [SSH: nas]","depth":22,"bounds":{"left":0.022938829,"top":0.07581804,"width":0.045877658,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"SCREENPIPE [SSH: NAS]","depth":23,"bounds":{"left":0.022938829,"top":0.079010375,"width":0.045877658,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.07980846,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":20,"bounds":{"left":0.025598405,"top":0.07980846,"width":0.043218084,"height":0.0103751}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.09577015,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"#recycle","depth":27,"bounds":{"left":0.026263298,"top":0.09577015,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.096568234,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":7,"bounds":{"left":0.028922873,"top":0.096568234,"width":0.01462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.11332801,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app","depth":27,"bounds":{"left":0.026263298,"top":0.11332801,"width":0.0076462766,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.11412609,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":2,"bounds":{"left":0.028590426,"top":0.11412609,"width":0.005319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.11412609,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.13088587,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"data","depth":27,"bounds":{"left":0.026263298,"top":0.13088587,"width":0.008976064,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.13168396,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.028922873,"top":0.13168396,"width":0.0063164895,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.14844373,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"logs","depth":27,"bounds":{"left":0.026263298,"top":0.14844373,"width":0.00831117,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.14924182,"width":0.0009973404,"height":0.011971269}},{"char_start":1,"char_count":3,"bounds":{"left":0.027260639,"top":0.14924182,"width":0.0076462766,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.10638298,"top":0.14924182,"width":0.004654255,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":26,"bounds":{"left":0.019946808,"top":0.1660016,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes","depth":27,"bounds":{"left":0.026263298,"top":0.1660016,"width":0.010970744,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.16679968,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":4,"bounds":{"left":0.028922873,"top":0.16679968,"width":0.00831117,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.1819633,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":27,"bounds":{"left":0.026263298,"top":0.18355946,"width":0.018949468,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.18435754,"width":0.0013297872,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.027593086,"top":0.18435754,"width":0.017952127,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.19952115,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"app_settings.json","depth":27,"bounds":{"left":0.026263298,"top":0.20111732,"width":0.03557181,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2019154,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":16,"bounds":{"left":0.028590426,"top":0.2019154,"width":0.03324468,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.21707901,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db","depth":27,"bounds":{"left":0.026263298,"top":0.21867518,"width":0.020944148,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.21947326,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":9,"bounds":{"left":0.028590426,"top":0.21947326,"width":0.01861702,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.23463687,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db-bak","depth":27,"bounds":{"left":0.026263298,"top":0.23623304,"width":0.03025266,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.23703113,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":13,"bounds":{"left":0.028590426,"top":0.23703113,"width":0.027925532,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.23703113,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.25219473,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"archive.db.bak-pre-installid","depth":27,"bounds":{"left":0.026263298,"top":0.25379092,"width":0.055518616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.254589,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":27,"bounds":{"left":0.028590426,"top":0.254589,"width":0.05319149,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.2697526,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite","depth":27,"bounds":{"left":0.026263298,"top":0.27134877,"width":0.017287234,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.27214685,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":8,"bounds":{"left":0.028922873,"top":0.27214685,"width":0.014960106,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.28731045,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-shm","depth":27,"bounds":{"left":0.026263298,"top":0.28890663,"width":0.027925532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.2897047,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.2897047,"width":0.025265958,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3048683,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"db.sqlite-wal","depth":27,"bounds":{"left":0.026263298,"top":0.3064645,"width":0.025930852,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.30726257,"width":0.0026595744,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028922873,"top":0.30726257,"width":0.023603724,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.32242617,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_fts_migrate.sh","depth":27,"bounds":{"left":0.026263298,"top":0.32402235,"width":0.053856384,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.32482043,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":24,"bounds":{"left":0.028590426,"top":0.32482043,"width":0.051529255,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.33998403,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync_updated.sh","depth":27,"bounds":{"left":0.026263298,"top":0.3415802,"width":0.059175532,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.3423783,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":25,"bounds":{"left":0.028590426,"top":0.3423783,"width":0.056848403,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"U","depth":27,"bounds":{"left":0.107380316,"top":0.3423783,"width":0.0029920214,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.3575419,"width":0.0063164895,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe_sync.sh","depth":27,"bounds":{"left":0.026263298,"top":0.35913807,"width":0.039893616,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.35993615,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":17,"bounds":{"left":0.028590426,"top":0.35993615,"width":0.037898935,"height":0.011971269}}],"role_description":"text"},{"role":"AXStaticText","text":"M","depth":27,"bounds":{"left":0.106715426,"top":0.35993615,"width":0.003656915,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":27,"bounds":{"left":0.018949468,"top":0.37509975,"width":0.0076462766,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"screenpipe.db","depth":27,"bounds":{"left":0.026263298,"top":0.37669593,"width":0.028590426,"height":0.011971269},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.026263298,"top":0.377494,"width":0.0023271276,"height":0.011971269}},{"char_start":1,"char_count":12,"bounds":{"left":0.028590426,"top":0.377494,"width":0.026595745,"height":0.011971269}}],"role_description":"text"},{"role":"AXButton","text":"Outline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9473264,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.9497207,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"OUTLINE","depth":22,"bounds":{"left":0.022938829,"top":0.9473264,"width":0.01662234,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"OUTLINE","depth":23,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.01662234,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.95131683,"width":0.0029920214,"height":0.0103751}},{"char_start":1,"char_count":6,"bounds":{"left":0.025930852,"top":0.95131683,"width":0.013630319,"height":0.0103751}}],"role_description":"text"},{"role":"AXButton","text":"Timeline Section","depth":21,"bounds":{"left":0.016289894,"top":0.9648843,"width":0.09940159,"height":0.017557861},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":23,"bounds":{"left":0.016954787,"top":0.96727854,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXHeading","text":"TIMELINE","depth":22,"bounds":{"left":0.022938829,"top":0.9648843,"width":0.01761968,"height":0.017557861},"on_screen":true,"role_description":"heading"},{"role":"AXStaticText","text":"TIMELINE","depth":23,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.01761968,"height":0.0103751},"on_screen":true,"lines":[{"char_start":0,"char_count":1,"bounds":{"left":0.022938829,"top":0.9688747,"width":0.0026595744,"height":0.0103751}},{"char_start":1,"char_count":7,"bounds":{"left":0.025598405,"top":0.9688747,"width":0.015292553,"height":0.0103751}}],"role_description":"text"},{"role":"AXRadioButton","text":"app_settings.json, Editor Group 1","depth":28,"bounds":{"left":0.116023935,"top":0.047885075,"width":0.055851065,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync.sh, Editor Group 1","depth":28,"bounds":{"left":0.171875,"top":0.047885075,"width":0.06549202,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_fts_migrate.sh, Editor Group 1","depth":28,"bounds":{"left":0.23736702,"top":0.047885075,"width":0.07413564,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"screenpipe_sync_updated.sh, preview, Editor Group 1","depth":28,"bounds":{"left":0.31150267,"top":0.047885075,"width":0.0831117,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":"pipe.md, Editor Group 1","depth":28,"bounds":{"left":0.39461437,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXRadioButton","text":".env, Editor Group 1","depth":28,"bounds":{"left":0.43450797,"top":0.047885075,"width":0.039893616,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":28,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"value":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","role_description":"editor","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"done\n\n step \"Reconciling NAS schema with source\"\n for tbl in \"${ALL_SYNC_TABLES[@]}\"; do\n ensure_columns \"$tbl\"\n done\n\n run_sqlite_heredoc \"creating indexes\" \"\nATTACH '$NAS_DB' AS nas;\n-- vision\nCREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);\nCREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);\nCREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);\nCREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);\n-- audio\nCREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);\nCREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);\nCREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);\nDETACH nas;\n\"\n\n # ─── FTS TABLES (contentless, install-safe) ───────────────────────────────\n run_sqlite_heredoc \"creating FTS tables\" \"\nATTACH '$NAS_DB' AS nas;\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(\n full_text, app_name, window_name, browser_url,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(\n text, role,\n install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(\n text_content, app_name, window_title, element_name,\n install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nCREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(\n transcription, device,\n speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,\n tokenize='unicode61'\n);\nDETACH nas;\n\"\n\n # ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────\n FRAMES_COLS=$(build_col_list frames)\n ELEMENTS_COLS=$(build_col_list elements)\n ELEMENTS_COLS_E=$(build_col_list elements e)\n UI_EVENTS_COLS=$(build_col_list ui_events)\n OCR_TEXT_COLS=$(build_col_list ocr_text)\n OCR_TEXT_COLS_O=$(build_col_list ocr_text o)\n VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)\n MEETINGS_COLS=$(build_col_list meetings)\n ACHUNKS_COLS=$(build_col_list audio_chunks)\n ATRANS_COLS=$(build_col_list audio_transcriptions)\n ATRANS_COLS_T=$(build_col_list audio_transcriptions t)\n SPEAKERS_COLS=$(build_col_list speakers)\n SEMB_COLS=$(build_col_list speaker_embeddings)\n ATAGS_COLS=$(build_col_list audio_tags)\n ATAGS_COLS_AT=$(build_col_list audio_tags at)\n TAGS_COLS=$(build_col_list tags)\n VTAGS_COLS=$(build_col_list vision_tags)\n VTAGS_COLS_VT=$(build_col_list vision_tags vt)\n\n # ─── SYNC VISION DATA ─────────────────────────────────────────────────────\n step \"Syncing vision data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"video_chunks\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)\n SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks\n WHERE id IN (\n SELECT DISTINCT video_chunk_id FROM main.frames\n WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL\n );\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"frames ($SRC_FRAMES rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)\n SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ocr_text ($SRC_OCR rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)\n SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o\n JOIN main.frames f ON o.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events ($SRC_UI rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)\n SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements ($SRC_ELEMENTS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)\n SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e\n JOIN main.frames f ON e.frame_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"meetings ($SRC_MEETINGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)\n SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────\n step \"Syncing audio data for $TARGET_DATE\"\n\n run_sqlite_heredoc \"speakers ($SRC_SPEAKERS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)\n SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"speaker_embeddings ($SRC_SEMB rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)\n SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_chunks ($SRC_ACHUNKS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)\n SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions ($SRC_ATRANS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)\n SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t\n JOIN main.audio_chunks c ON t.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_tags ($SRC_ATAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)\n SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at\n JOIN main.audio_chunks c ON at.audio_chunk_id = c.id\n WHERE date(c.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── SYNC SHARED ──────────────────────────────────────────────────────────\n step \"Syncing shared tables (tags, vision_tags)\"\n\n run_sqlite_heredoc \"tags ($SRC_TAGS rows, all)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)\n SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"vision_tags ($SRC_VTAGS rows)\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)\n SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt\n JOIN main.frames f ON vt.vision_id = f.id\n WHERE date(f.timestamp) = '$TARGET_DATE';\nDETACH nas;\n\"\n\n # ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────\n # No `rowid` specified; SQLite assigns a fresh one. install_id + source_id\n # are UNINDEXED columns so JOIN-back-to-base queries work.\n step \"Updating FTS indexes\"\n\n run_sqlite_heredoc \"frames_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)\n SELECT full_text, app_name, window_name, browser_url, install_id, id\n FROM nas.frames\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND full_text IS NOT NULL AND full_text != '';\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"elements_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)\n SELECT e.text, e.role, e.install_id, e.id, e.frame_id\n FROM nas.elements e\n JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id\n WHERE date(f.timestamp) = '$TARGET_DATE'\n AND e.install_id = '$INSTALL_ID'\n AND e.text IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"ui_events_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)\n SELECT text_content, app_name, window_title, element_name, install_id, id\n FROM nas.ui_events\n WHERE date(timestamp) = '$TARGET_DATE'\n AND install_id = '$INSTALL_ID'\n AND text_content IS NOT NULL;\nDETACH nas;\n\"\n\n run_sqlite_heredoc \"audio_transcriptions_fts\" \"\nATTACH '$NAS_DB' AS nas;\nINSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)\n SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id\n FROM nas.audio_transcriptions t\n JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id\n WHERE date(c.timestamp) = '$TARGET_DATE'\n AND t.install_id = '$INSTALL_ID'\n AND t.transcription IS NOT NULL AND t.transcription != '';\nDETACH nas;\n\"\n\n # ─── VERIFY ───────────────────────────────────────────────────────────────\n step \"Verifying DB\"\n\n V_FRAMES=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ELEMENTS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_UI=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_OCR=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_MEETINGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ACHUNKS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';\")\n V_ATRANS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_ATAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n V_VTAGS=$(sqlite3 \"$NAS_DB\" \"SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');\")\n\n check \"frames\" \"$V_FRAMES\" \"$SRC_FRAMES\"\n check \"elements\" \"$V_ELEMENTS\" \"$SRC_ELEMENTS\"\n check \"ui_events\" \"$V_UI\" \"$SRC_UI\"\n check \"ocr_text\" \"$V_OCR\" \"$SRC_OCR\"\n check \"meetings\" \"$V_MEETINGS\" \"$SRC_MEETINGS\"\n check \"audio_chunks\" \"$V_ACHUNKS\" \"$SRC_ACHUNKS\"\n check \"audio_transcriptions\" \"$V_ATRANS\" \"$SRC_ATRANS\"\n check \"audio_tags\" \"$V_ATAGS\" \"$SRC_ATAGS\"\n check \"vision_tags\" \"$V_VTAGS\" \"$SRC_VTAGS\"\n\nfi\n\n# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────\nstep \"Copying frame data folder for $TARGET_DATE\"\n\nif [ -d \"$DATA_SRC\" ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync frames → NAS\"\n rsync -a --ignore-existing \"$DATA_SRC/\" \"$NAS_DATA/$TARGET_DATE/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_FILES=$(ls \"$NAS_DATA/$TARGET_DATE\" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')\n SRC_FILES=$(ls \"$DATA_SRC\" | wc -l | tr -d ' ')\n COPIED_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE\" | cut -f1)\n if [ \"$COPIED_FILES\" -ge \"$SRC_FILES\" ]; then\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync frames → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_FILES\" \"$COPIED_SIZE\" | tee -a \"$LOG_FILE\"\n else\n printf \"\\r %-40s ✗ %s / %s files\\n\" \"rsync frames → NAS\" \"$COPIED_FILES\" \"$SRC_FILES\" | tee -a \"$LOG_FILE\"\n fi\nelse\n printf \" %-40s %s\\n\" \"rsync frames → NAS\" \"skipped (no source dir)\"\nfi\n\n# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────\n# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.\n# System Audio (output)_2026-05-11_13-48-12.mp4\n# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4\n# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.\nstep \"Copying audio files for $TARGET_DATE\"\n\nshopt -s nullglob\nAUDIO_FILES=( \"$HOME/.screenpipe/data/\"*_\"${TARGET_DATE}\"_*.mp4 )\nshopt -u nullglob\n\nif [ ${#AUDIO_FILES[@]} -gt 0 ]; then\n mkdir -p \"$NAS_DATA/$TARGET_DATE/audio\"\n RSYNC_START=$(date +%s)\n printf \" %-40s \" \"rsync audio → NAS\"\n rsync -a --ignore-existing \"${AUDIO_FILES[@]}\" \"$NAS_DATA/$TARGET_DATE/audio/\" 2>>\"$LOG_FILE\"\n RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))\n COPIED_AUDIO=$(ls \"$NAS_DATA/$TARGET_DATE/audio\" | wc -l | tr -d ' ')\n AUDIO_SIZE=$(du -sh \"$NAS_DATA/$TARGET_DATE/audio\" | cut -f1)\n printf \"\\r %-40s ✓ %dm%02ds (%s files, %s)\\n\" \\\n \"rsync audio → NAS\" \"$(( RSYNC_DUR / 60 ))\" \"$(( RSYNC_DUR % 60 ))\" \\\n \"$COPIED_AUDIO\" \"$AUDIO_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync audio → NAS\" \"skipped (no audio for date)\"\nfi\n\n# ─── COPY LOGS ────────────────────────────────────────────────────────────────\nstep \"Copying screenpipe logs for $TARGET_DATE\"\n\nNAS_LOGS=\"$NAS_MOUNT/logs\"\nmkdir -p \"$NAS_LOGS\"\n\nshopt -s nullglob\nLOG_FILES=( \"$HOME/.screenpipe/screenpipe.$TARGET_DATE.\"*.log )\nshopt -u nullglob\n\nif [ ${#LOG_FILES[@]} -gt 0 ]; then\n printf \" %-40s \" \"rsync logs → NAS\"\n rsync -a \"${LOG_FILES[@]}\" \"$NAS_LOGS/\" 2>>\"$LOG_FILE\"\n TOTAL_SIZE=$(du -ch \"${LOG_FILES[@]}\" | tail -1 | cut -f1)\n printf \"✓ %d file(s), %s\\n\" \"${#LOG_FILES[@]}\" \"$TOTAL_SIZE\" | tee -a \"$LOG_FILE\"\nelse\n printf \" %-40s %s\\n\" \"rsync logs → NAS\" \"skipped (no matching logs)\"\nfi\n\n# ─── SUMMARY ──────────────────────────────────────────────────────────────────\nTOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))\nDB_SIZE=$(du -sh \"$NAS_DB\" | cut -f1)\n\necho \"\"\nlog \"Archive DB size: $DB_SIZE\"\nlog \"Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s\"\nlog \"Sync complete for $TARGET_DATE (install $INSTALL_ID)\"\nlog \"========================================\"\n\nrsync -a \"$HOME/.screenpipe/sync.log\" \"$NAS_LOGS/sync.log\" 2>/dev/null || true","depth":29,"bounds":{"left":0.116023935,"top":0.0933759,"width":0.38031915,"height":0.0007980846},"on_screen":true,"role_description":"text"},{"role":"AXRadioButton","text":"Implement and run pipe l…, Editor Group 2","depth":28,"bounds":{"left":0.5581782,"top":0.047885075,"width":0.073803194,"height":0.02793296},"on_screen":true,"role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true,"is_expanded":false},{"role":"AXButton","text":"remote SSH: nas","depth":16,"bounds":{"left":0.0009973404,"top":0.98244214,"width":0.028590426,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.003656915,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"SSH: nas","depth":17,"bounds":{"left":0.008976064,"top":0.9856345,"width":0.017952127,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - master*, Checkout Branch/Tag...","depth":16,"bounds":{"left":0.03125,"top":0.98244214,"width":0.023271276,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.032247342,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"master*","depth":17,"bounds":{"left":0.03756649,"top":0.9856345,"width":0.015957447,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"screenpipe (Git) - Synchronize Changes","depth":16,"bounds":{"left":0.054521278,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"No Problems","depth":16,"bounds":{"left":0.064494684,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.06615692,"top":0.9848364,"width":0.005319149,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.071476065,"top":0.9856345,"width":0.004986702,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.076130316,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"0","depth":17,"bounds":{"left":0.08144947,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Forwarded Ports: 8766","depth":16,"bounds":{"left":0.0887633,"top":0.98244214,"width":0.012632979,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.09042553,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":17,"bounds":{"left":0.095744684,"top":0.9856345,"width":0.0039893617,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Notifications","depth":16,"bounds":{"left":0.9890292,"top":0.98244214,"width":0.010638298,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sign In","depth":16,"bounds":{"left":0.96542555,"top":0.98244214,"width":0.022606382,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"","depth":17,"bounds":{"left":0.96708775,"top":0.9848364,"width":0.0056515955,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Sign In","depth":17,"bounds":{"left":0.9724069,"top":0.9856345,"width":0.013962766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Shell Script","depth":16,"bounds":{"left":0.93949467,"top":0.98244214,"width":0.023603724,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions","depth":16,"bounds":{"left":0.9321808,"top":0.98244214,"width":0.00731383,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"LF","depth":16,"bounds":{"left":0.9215425,"top":0.98244214,"width":0.007978723,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"UTF-8","depth":16,"bounds":{"left":0.90392286,"top":0.98244214,"width":0.015625,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Spaces: 2","depth":16,"bounds":{"left":0.8799867,"top":0.98244214,"width":0.022273935,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Ln 846, Col 59","depth":16,"bounds":{"left":0.84674203,"top":0.98244214,"width":0.03158245,"height":0.01755786},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Info: Downloading VS Code Server...","depth":12,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Implement and run pipe logic","depth":19,"bounds":{"left":0.56050533,"top":0.08060654,"width":0.07114362,"height":0.022346368},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Session history","depth":19,"bounds":{"left":0.97839093,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"Session history","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"New session","depth":19,"bounds":{"left":0.9890292,"top":0.08060654,"width":0.00930851,"height":0.022346368},"on_screen":true,"help_text":"New session","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"main.py","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"lets implement logic with pipes. how can I run it?","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me look at the current project structure to understand what's already in place.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List project files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"find /volume1/screenpipe -type f | head -50 && echo \"---\" && ls /volume1/screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/.DS_Store\n/volume1/screenpipe/screenpipe.db\n/volume1/screenpipe/screenpipe_sync.sh\n/volume1/screenpipe/app_settings.json\n/volume1/screenpipe/.gitignore\n/volume1/screenpipe/archive.db\n/volume1/screenpipe/db.sqlite\n/volume1/screenpipe/db.sqlite-wal\n/volume1/screenpipe/db.sqlite-shm\n/volume1/screenpipe/#recycle/desktop.ini\n/volume1/screenpipe/#recycle/db.sqlite\n/volume1/screenpipe/#recycle/Copy #1 of db.sqlite\n/volume1/screenpipe/#recycle/.DS_Store\n/volume1/screenpipe/#recycle/Copy #2 of db.sqlite\n/volume1/screenpipe/#recycle/archive.db\n/volume1/screenpipe/#recycle/Copy #1 of archive.db\n/volume1/screenpipe/#recycle/Copy #2 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of archive.db\n/volume1/screenpipe/#recycle/Copy #4 of archive.db\n/volume1/screenpipe/#recycle/Copy #5 of archive.db\n/volume1/screenpipe/#recycle/Copy #3 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #4 of db.sqlite\n/volume1/screenpipe/#recycle/Copy #6 of archive.db\n/volume1/screenpipe/#recycle/test.txt\n/volume1/screenpipe/#recycle/Copy #7 of archive.db\n/volume1/screenpipe/#recycle/Copy #8 of archive.db\n/volume1/screenpipe/#recycle/archive.db-journal\n/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal\n/volume1/screenpipe/#recycle/Copy #5 of db.sqlite\n/volume1/screenpipe/pipes/.DS_Store\n/volume1/screenpipe/app/.env\n/volume1/screenpipe/app/cli.py\n/volume1/screenpipe/app/.DS_Store\n/volume1/screenpipe/app/db.py\n/volume1/screenpipe/app/docker-compose.yml\n/volume1/screenpipe/app/main.py\n/volume1/screenpipe/app/requirements.txt\n/volume1/screenpipe/app/Dockerfile\n/volume1/screenpipe/data/.DS_Store\n/volume1/screenpipe/.git/description\n/volume1/screenpipe/.git/HEAD\n/volume1/screenpipe/.git/index\n/volume1/screenpipe/.git/COMMIT_EDITMSG\n/volume1/screenpipe/#recycle/data/.DS_Store\n---\napp\napp_settings.json\narchive.db\ndata\ndb.sqlite\ndb.sqlite-shm\ndb.sqlite-wal\npipes\n#recycle\nscreenpipe.db\nscreenpipe_sync.sh","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check pipes directory and docker-compose","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\ncli.py\nconsumers\ndb.py\ndocker-compose.yml\nDockerfile\nmain.py\n__pycache__\nrequirements.txt\nstatic\nservices:\n screenpipe-app:\n build: .\n container_name: screenpipe-app\n restart: unless-stopped\n ports:\n - \"8766:8000\"\n volumes:\n - /volume1/screenpipe:/data\n env_file:\n - .env\n environment:\n TZ: Europe/Sofia\n DB_PATH: /data/db.sqlite\n\n sqlite-web-archive:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-archive\n restart: unless-stopped\n ports:\n - \"8767:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/archive.db\"]\n\n sqlite-web-live:\n image: ghcr.io/coleifer/sqlite-web:latest\n container_name: screenpipe-sqlweb-live\n restart: unless-stopped\n ports:\n - \"8768:8080\"\n volumes:\n - /volume1/screenpipe:/data\n command: [\"-H\", \"0.0.0.0\", \"-r\", \"/data/db.sqlite\"]","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"requirements.txt","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Inspect a pipe directory","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md\npipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"List all pipes and their contents","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo \"=== $d ===\"; ls \"$d\"; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ai-habits\nday-recap\nmeeting-summary\nstandup-update\ntime-breakdown\nvideo-export\n=== /volume1/screenpipe/pipes/ai-habits/ ===\npipe.md\n=== /volume1/screenpipe/pipes/day-recap/ ===\npipe.md\n=== /volume1/screenpipe/pipes/meeting-summary/ ===\npipe.md\n=== /volume1/screenpipe/pipes/standup-update/ ===\npipe.md\n=== /volume1/screenpipe/pipes/time-breakdown/ ===\npipe.md\n=== /volume1/screenpipe/pipes/video-export/ ===\npipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read pipe markdown files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo \"===\" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read summary consumer","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"activity.py\naudio.py\nelements.py\n__init__.py\ninteractions.py\nocr.py\n__pycache__\nreport.py\nsummary.py\n\"\"\"AI summary generator using Claude.\"\"\"\nimport os\nfrom datetime import date\nfrom typing import Any\n\nfrom consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary\nfrom consumers.ocr import deduplicated_text\nfrom consumers.audio import formatted_transcript\n\n\nSUMMARY_TYPES = {\n \"day_recap\": {\n \"title\": \"Day Recap\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a concise day recap using EXACTLY this format:\n\n## Summary\nOne sentence: what I mainly worked on today.\n\n## Accomplishments\n- Top 3 things I finished, with approximate times\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things seen or heard, with timestamps\n\n## Unfinished Work\n- What to continue tomorrow\n\n## Patterns\n- Apps used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with:\n**Next step:** [most important thing to continue]\"\"\",\n },\n \"standup\": {\n \"title\": \"Standup Update\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\n## Audio/speech:\n{audio}\n\nWrite a brief standup update:\n\n**Yesterday:** What I worked on (2-3 bullets)\n**Today:** What I plan to continue (1-2 bullets)\n**Blockers:** Any issues observed (or \"None\")\n\nKeep it under 150 words. Only report what's verifiable from the data.\"\"\",\n },\n \"focus_time\": {\n \"title\": \"Focus & Distraction Analysis\",\n \"prompt\": \"\"\"\\\nYou are analyzing a person's computer activity for the day.\n\n## App usage (minutes per app):\n{app_time}\n\n## Browser URLs visited:\n{browser_urls}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_events}\n\n## Screen content (sampled every 5 minutes):\n{ocr_text}\n\nAnalyze focus vs distraction patterns:\n\n## Deep Work Periods\n- When and how long were sustained focus sessions?\n- What was being worked on?\n\n## Distractions\n- Which apps/sites were used recreationally?\n- How much time was lost to context switching?\n\n## Recommendations\n- 2-3 concrete suggestions to improve focus tomorrow\n\nBe specific with times and app names.\"\"\",\n },\n}\n\n\ndef _build_context(for_date: date) -> dict[str, str]:\n apps = app_time(for_date)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(for_date, limit=20)\n url_lines = \"\\n\".join(\n f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls\n )\n\n ui_rows = ui_event_summary(for_date)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(for_date, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(for_date)\n\n return {\n \"app_time\": app_lines or \"(no app data)\",\n \"browser_urls\": url_lines or \"(no browser data)\",\n \"ui_events\": ui_lines or \"(no UI event data)\",\n \"ocr_text\": ocr_lines or \"(no screen data)\",\n \"audio\": audio[:3000] if len(audio) > 3000 else audio,\n }\n\n\ndef generate(\n summary_type: str = \"day_recap\",\n for_date: date | None = None,\n api_key: str | None = None,\n) -> dict[str, Any]:\n \"\"\"Generate an AI summary. Returns dict with 'title', 'content', 'date'.\"\"\"\n import anthropic\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\n \"title\": \"Error\",\n \"content\": \"ANTHROPIC_API_KEY not set. Add it to your .env file.\",\n \"date\": str(d),\n }\n\n spec = SUMMARY_TYPES.get(summary_type)\n if not spec:\n return {\"title\": \"Error\", \"content\": f\"Unknown summary type: {summary_type}\", \"date\": str(d)}\n\n stats = summary_stats(d)\n if stats[\"total_frames\"] == 0:\n return {\n \"title\": spec[\"title\"],\n \"content\": f\"No screen data found for {d}.\",\n \"date\": str(d),\n }\n\n ctx = _build_context(d)\n prompt = spec[\"prompt\"].format(**ctx)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n messages=[{\"role\": \"user\", \"content\": prompt}],\n )\n\n return {\n \"title\": spec[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read all pipe.md files","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"for f in /volume1/screenpipe/pipes/*/pipe.md; do echo \"=== $f ===\"; cat \"$f\"; echo; done","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: AI Habits\ndescription: \"How you use AI tools — patterns and insights\"\nicon: \"🤖\"\nfeatured: true\n---\n\nSearch my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## AI Tools Used\n- List each tool with approximate time spent (e.g. \"Claude: ~45min\")\n\n## What I Used Them For\n- For each tool: coding, writing, research, or brainstorming\n\n## Usage Patterns\n- Do I switch between tools? Use them in bursts or steadily?\n\n## Effectiveness\n- Which tool appeared alongside completed work vs. abandoned attempts\n\nIf no AI usage is found, say so clearly. End with: \"**Tip:** [one suggestion to use AI tools more effectively]\"\n\n=== /volume1/screenpipe/pipes/day-recap/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Day Recap\ndescription: \"Today's accomplishments, key moments, and unfinished work\"\nicon: \"📋\"\nfeatured: true\n---\n\nAnalyze my screen and audio recordings from today (last 16 hours only). \n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Summary\nOne sentence: what I mainly did today.\n\n## Accomplishments\n- Top 3 things I finished, with timestamps (e.g. \"2:30 PM\")\n- Name specific apps, files, or projects\n\n## Key Moments\n- Important things I saw, said, or heard — with timestamps\n\n## Unfinished Work\n- What I should continue tomorrow — name the app/file/task\n\n## Patterns\n- Apps I used most, topics that came up repeatedly\n\nOnly report what you can verify from the data. End with: \"**Next step:** [most important thing to continue]\"\n\n=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Meeting Summary\ndescription: \"Summarize meeting transcript with key takeaways and action items\"\nicon: \"🤝\"\nfeatured: false\n---\n\nSummarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Meeting Summary\nOne sentence: what this meeting was about.\n\n## Key Takeaways\n- Top 3-5 important points discussed\n- Include who said what when relevant\n\n## Action Items\n- [ ] Task — assigned to whom, deadline if mentioned\n- [ ] Task — assigned to whom\n\n## Decisions Made\n- List any decisions or agreements reached\n\n## Open Questions\n- Anything unresolved or needing follow-up\n\nKeep it concise and actionable.\n\n=== /volume1/screenpipe/pipes/standup-update/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Standup Update\ndescription: \"What you did, what's next, and any blockers\"\nicon: \"🏢\"\nfeatured: true\n---\n\nBased on my recordings from the last 24 hours, generate a standup update. Use limit=10 per search, max 3 searches total.\n\nRead screenpipe skill first.\n\nUse this exact format:\n\n## Yesterday\n- What I worked on (name specific projects, files, tools, PRs)\n\n## Today\n- What I will work on next (based on unfinished tasks and recent activity)\n\n## Blockers\n- Issues I hit — errors, slow builds, waiting on someone\n- If no blockers, write \"None\"\n\nKeep it under 150 words. Copy-paste ready for a team standup.\n\n=== /volume1/screenpipe/pipes/time-breakdown/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Time Breakdown\ndescription: \"Where your time went — by app, project, and category\"\nicon: \"⏱\"\nfeatured: false\n---\n\nAnalyze my app usage from today (last 12 hours). Use limit=10 per search, max 4 searches. Prefer /raw_sql with COUNT/GROUP BY queries.\n\nRead screenpipe skill first.\n\nUse this exact format with durations and percentages:\n\n## By Application\n- List each app with duration and percentage, sorted by time (e.g. \"VS Code: 2h 15min (28%)\")\n\n## By Category\n- Group into: coding, meetings, browsing, writing, communication, other\n- Show hours and percentage per category\n\n## By Project\n- Group related activities by project/topic. Name specific repos or tasks.\n\n## Productivity Score\n- Calculate: focused_work_hours / total_hours as a percentage\n- Focused = coding + writing. Unfocused = browsing + switching.\n\nEnd with: \"**Suggestion:** [one specific change to improve tomorrow's productivity]\"\n\n=== /volume1/screenpipe/pipes/video-export/pipe.md ===\n---\nschedule: manual\nenabled: true\ntemplate: true\ntitle: Export Video Clip\ndescription: \"Create a video of your recent screen activity\"\nicon: \"🎬\"\nfeatured: false\n---\n\nExport a video of my screen activity from the last 5 minutes.\n\nRead screenpipe skill first.\n\nUse the POST /frames/export endpoint with the time range and fps=1.0. Then show me the exported video file path as an inline code block so I can watch it.\n\nIf the export is large, suggest a lower fps or shorter time range.","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now I have a clear picture. The pipes are markdown prompt templates in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe/pipes/","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", but there's no code to actually load and run them —","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"has its own hardcoded prompts instead.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Here's what I'll implement:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"consumers/pipes.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— dynamically loads pipe.md files and runs them via Claude (data injected as system message, pipe body as user prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— two new endpoints:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GET /api/pipes","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"POST /api/pipes/{pipe_id}/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cli.py","depth":26,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— a","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"command to run pipes from the terminal","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Let me build it:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check browser_urls signature","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/consumers/activity.py | grep \"def browser_urls\" -A 5","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"def browser_urls(\n for_date: date | None = None,\n app_name: str | None = None,\n ts_from: str | None = None,\n ts_to: str | None = None,\n limit: int = 30,","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Write","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"pipes.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipes.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"143 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"\"\"\"Dynamic pipe loader and runner.\"\"\"\nimport os\nimport re\nfrom datetime import date\nfrom pathlib import Path\nfrom typing import Any\n\n\ndef _parse_frontmatter(text: str) -> tuple[dict, str]:\n if not text.startswith(\"---\"):\n return {}, text\n try:\n end = text.index(\"---\", 3)\n except ValueError:\n return {}, text\n fm_text = text[3:end].strip()\n body = text[end + 3:].strip()\n meta: dict = {}\n for line in fm_text.splitlines():\n if \":\" in line:\n k, _, v = line.partition(\":\")\n meta[k.strip()] = v.strip().strip('\"')\n return meta, body\n\n\ndef load_pipes(pipes_dir: Path) -> list[dict]:\n if not pipes_dir.exists():\n return []\n pipes = []\n for pipe_dir in sorted(pipes_dir.iterdir()):\n if not pipe_dir.is_dir() or pipe_dir.name.startswith(\".\"):\n continue\n pipe_md = pipe_dir / \"pipe.md\"\n if not pipe_md.exists():\n continue\n text = pipe_md.read_text(encoding=\"utf-8\")\n meta, body = _parse_frontmatter(text)\n if meta.get(\"enabled\", \"true\").lower() == \"false\":\n continue\n body = re.sub(r\"Read screenpipe skill first\\.?\\n?\", \"\", body).strip()\n pipes.append({\n \"id\": pipe_dir.name,\n \"title\": meta.get(\"title\", pipe_dir.name),\n \"description\": meta.get(\"description\", \"\"),\n \"icon\": meta.get(\"icon\", \"\"),\n \"schedule\": meta.get(\"schedule\", \"manual\"),\n \"featured\": meta.get(\"featured\", \"false\").lower() == \"true\",\n \"prompt\": body,\n })\n return pipes\n\n\ndef _build_system(d: date, stats: dict) -> str:\n from consumers.activity import app_time, browser_urls, ui_event_summary\n from consumers.ocr import deduplicated_text\n from consumers.audio import formatted_transcript\n\n apps = app_time(d)\n app_lines = \"\\n\".join(f\"- {a['app_name']}: {a['minutes']} min\" for a in apps[:20])\n\n urls = browser_urls(d, limit=20)\n url_lines = \"\\n\".join(f\"- {u['browser_url'][:100]} ({u['minutes']} min)\" for u in urls)\n\n ui_rows = ui_event_summary(d)\n ui_lines = \"\\n\".join(\n f\"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches\"\n for r in ui_rows[:15]\n )\n\n ocr_rows = deduplicated_text(d, chunk_minutes=5)\n ocr_lines = \"\\n\".join(\n f\"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}\"\n for r in ocr_rows[:100]\n )\n\n audio = formatted_transcript(d)\n if len(audio) > 3000:\n audio = audio[:3000]\n\n return f\"\"\"You are analyzing screenpipe data — recordings of a person's computer activity.\n\n## App usage (minutes per app):\n{app_lines or '(no app data)'}\n\n## Browser URLs visited:\n{url_lines or '(no browser data)'}\n\n## UI activity per app (clicks / keystrokes / app-switches):\n{ui_lines or '(no UI event data)'}\n\n## Screen content (sampled every 5 minutes):\n{ocr_lines or '(no screen data)'}\n\n## Audio / speech:\n{audio or '(no audio data)'}\n\nDate: {d}\nTotal frames recorded: {stats['total_frames']}\"\"\"\n\n\ndef run_pipe(\n pipe_id: str,\n for_date: date | None = None,\n api_key: str | None = None,\n pipes_dir: Path | None = None,\n) -> dict[str, Any]:\n import anthropic\n from consumers.activity import summary_stats\n\n d = for_date or date.today()\n key = api_key or os.environ.get(\"ANTHROPIC_API_KEY\", \"\")\n if not key:\n return {\"title\": \"Error\", \"content\": \"ANTHROPIC_API_KEY not set.\", \"date\": str(d)}\n\n _pipes_dir = pipes_dir or Path(os.environ.get(\"PIPES_DIR\", \"/data/pipes\"))\n all_pipes = {p[\"id\"]: p for p in load_pipes(_pipes_dir)}\n\n if pipe_id not in all_pipes:\n return {\"title\": \"Error\", \"content\": f\"Pipe not found: {pipe_id}\", \"date\": str(d)}\n\n pipe = all_pipes[pipe_id]\n stats = summary_stats(d)\n\n if stats[\"total_frames\"] == 0:\n return {\"title\": pipe[\"title\"], \"content\": f\"No screen data found for {d}.\", \"date\": str(d)}\n\n system = _build_system(d, stats)\n\n client = anthropic.Anthropic(api_key=key)\n message = client.messages.create(\n model=\"claude-haiku-4-5-20251001\",\n max_tokens=1024,\n system=system,\n messages=[{\"role\": \"user\", \"content\": pipe[\"prompt\"]}],\n )\n\n return {\n \"title\": pipe[\"title\"],\n \"content\": message.content[0].text,\n \"date\": str(d),\n \"stats\": stats,\n }","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the API endpoints to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"main.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 1 line","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the pipe endpoints at the end of main.py, before the closing summary section:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"main.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"main.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 14 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Now add the CLI command to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Edit","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"cli.py","depth":24,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cli.py","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Added 40 lines","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Done. Here's how to run pipes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXHeading","text":"How to run pipes","depth":22,"on_screen":false,"role_description":"heading"},{"role":"AXStaticText","text":"How to run pipes","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via Docker (inside the running container):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe --list\ndocker exec -it screenpipe-app python cli.py pipe day-recap\ndocker exec -it screenpipe-app python cli.py pipe standup-update --date yesterday","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(once the container is running on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST \"http://localhost:8766/api/pipes/day-recap/run\"\ncurl -X POST \"http://localhost:8766/api/pipes/standup-update/run?d=2026-04-25\"","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Rebuild and restart","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"to pick up the changes:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"How it works:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Each","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipe.md","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"file is loaded dynamically — the frontmatter provides metadata and the body becomes the user prompt. Screenpipe data (app usage, browser URLs, OCR, audio) is injected as a Claude system message so the pipe prompt can reference it naturally. The \"Read screenpipe skill first\" line is stripped automatically.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The pipes directory inside Docker is","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data/pipes","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(since","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/volume1/screenpipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"→","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"/data","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"). You can override it with a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PIPES_DIR","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"env var if needed.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"where to place api key and can I use different keys","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Read .env file","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cat /volume1/screenpipe/app/.env","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Where to place the key:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"app/.env","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"app/.env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"— replace","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"your_key_here","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"with your actual key:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"ANTHROPIC_API_KEY=sk-ant-...","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"That file is loaded by","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"load_dotenv()","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"at startup and is excluded from git via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".gitignore","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Can you use different keys per pipe?","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Not currently — all pipes share the one key from","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". But you can add per-pipe key support by adding an","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"api_key","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"field to the pipe's frontmatter:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"---\ntitle: Meeting Summary\napi_key_env: ANTHROPIC_KEY_MEETINGS\n---","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Then in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", read it in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_parse_frontmatter","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and pass it through","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"run_pipe","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":". Want me to add that?","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"pipe.md","depth":23,"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"pipe.md","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"can I use mistral or other llm? or is is build for antrophic only","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Currently it's Anthropic-only — the code calls the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"anthropic","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SDK directly in both","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/pipes.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXLink","text":"consumers/summary.py","depth":23,"on_screen":false,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"consumers/summary.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Adding other providers is straightforward since Mistral, Ollama, OpenRouter, Groq, and most modern LLMs expose an OpenAI-compatible API. The cleanest approach: add the","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"package and let you configure the provider via","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":":","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# Anthropic (default)\nANTHROPIC_API_KEY=sk-ant-...\n\n# OR: any OpenAI-compatible provider\nLLM_PROVIDER=openai-compatible\nLLM_BASE_URL=https://api.mistral.ai/v1\nLLM_API_KEY=your-mistral-key\nLLM_MODEL=mistral-small-latest","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"This would cover Mistral, Ollama (","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"http://localhost:11434/v1","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"), OpenRouter, Groq, etc. with one code path.","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Want me to implement that? It's a small change — a","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"_call_llm(system, user_prompt)","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"helper in","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"pipes.py","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"that branches on","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LLM_PROVIDER","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":", and","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"openai","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"added to","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"requirements.txt","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.10853951,"width":0.0066489363,"height":0.0007980846},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"lets test it with anthropic first, how to run pipe","depth":25,"bounds":{"left":0.5674867,"top":0.10853951,"width":0.09275266,"height":0.0103751},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"on_screen":false,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Bash","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Check if container is running","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IN","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app && docker compose ps 2>/dev/null || docker ps --filter name=screenpipe","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":24,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"OUT","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Exit code 1\npermission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.45/containers/json?filters=%7B%22name%22%3A%7B%22screenpipe%22%3Atrue%7D%7D\": dial unix /var/run/docker.sock: connect: permission denied","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"I don't have Docker socket access, so you'll need to run these yourself. Here are your options:","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option A — via Docker (if container is already running):","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List available pipes\ndocker exec -it screenpipe-app python cli.py pipe --list\n\n# Run a specific pipe\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option B — rebuild first (since we added new files), then run:","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\ndocker compose up --build -d\ndocker exec -it screenpipe-app python cli.py pipe day-recap","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Option C — via the API","depth":24,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"(if container is up on port 8766):","depth":23,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"on_screen":false,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"# List pipes\ncurl http://localhost:8766/api/pipes\n\n# Run a pipe\ncurl -X POST http://localhost:8766/api/pipes/day-recap/run","depth":25,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"The","depth":23,"bounds":{"left":0.57513297,"top":0.11412609,"width":0.008976064,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"day-recap","depth":24,"bounds":{"left":0.58543885,"top":0.11572227,"width":0.021276595,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"or","depth":23,"bounds":{"left":0.60771275,"top":0.11412609,"width":0.0066489363,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"standup-update","depth":24,"bounds":{"left":0.6156915,"top":0.11572227,"width":0.032912236,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"pipes are the best ones to test first since they use all data sources. Which option works for you?","depth":23,"bounds":{"left":0.64960104,"top":0.11412609,"width":0.19448139,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.14046289,"width":0.0066489363,"height":0.015961692},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"how ot run for specifiday","depth":25,"bounds":{"left":0.5674867,"top":0.15403032,"width":0.049867023,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"bounds":{"left":0.57513297,"top":0.1915403,"width":0.023936171,"height":0.015961692},"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"bounds":{"left":0.57513297,"top":0.19313647,"width":0.017287234,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Docker exec:","depth":24,"bounds":{"left":0.57513297,"top":0.22186752,"width":0.027925532,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.24501197,"width":0.007978723,"height":0.019952115},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-25\n# or shortcuts:\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date yesterday\ndocker exec -it screenpipe-app python cli.py pipe day-recap --date today","depth":25,"bounds":{"left":0.5777925,"top":0.25059855,"width":0.18051861,"height":0.058260176},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"API:","depth":24,"bounds":{"left":0.57513297,"top":0.32482043,"width":0.008976064,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.34876296,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"curl -X POST \"http://localhost:8766/api/pipes/day-recap/run?d=2026-04-25\"","depth":25,"bounds":{"left":0.5777925,"top":0.35434955,"width":0.17121011,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.38946527,"width":0.0066489363,"height":0.016759777},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CaSoR75WgV8fTcHTYJMDY'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"bounds":{"left":0.5674867,"top":0.40303272,"width":0.3693484,"height":0.04708699},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Thinking","depth":23,"bounds":{"left":0.57513297,"top":0.47406226,"width":0.023936171,"height":0.015961692},"on_screen":true,"role_description":"disclosure triangle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Thinking","depth":24,"bounds":{"left":0.57513297,"top":0.47565842,"width":0.017287234,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"The container started before you updated the","depth":23,"bounds":{"left":0.57513297,"top":0.50359136,"width":0.0930851,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":".env","depth":24,"bounds":{"left":0.66921544,"top":0.5051876,"width":0.009640957,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":", so it's using the old placeholder key. Restart it to pick up the new one:","depth":23,"bounds":{"left":0.67985374,"top":0.50359136,"width":0.14361702,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.5275339,"width":0.007978723,"height":0.01915403},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"cd /volume1/screenpipe/app\nsudo docker compose restart screenpipe-app","depth":25,"bounds":{"left":0.5777925,"top":0.5331205,"width":0.09840426,"height":0.027134877},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Then try again:","depth":23,"bounds":{"left":0.57513297,"top":0.57621706,"width":0.03025266,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Copy code to clipboard","depth":23,"bounds":{"left":0.984375,"top":0.59936154,"width":0.007978723,"height":0.019952115},"on_screen":true,"help_text":"Copy code","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20","depth":25,"bounds":{"left":0.5777925,"top":0.6049481,"width":0.19215426,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.6408619,"width":0.0066489363,"height":0.015961692},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}, 'request_id': 'req_011CaSoaWfbMTbPTbw5PpBu1'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"bounds":{"left":0.5674867,"top":0.6544294,"width":0.36901596,"height":0.046288908},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Message actions","depth":24,"bounds":{"left":0.99035907,"top":0.7206704,"width":0.0066489363,"height":0.015961692},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":".env","depth":23,"bounds":{"left":0.5674867,"top":0.73264164,"width":0.016954787,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":".env","depth":25,"bounds":{"left":0.5744681,"top":0.7366321,"width":0.0076462766,"height":0.011173184},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"key is there now but Adm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$ sudo docker exec -it screenpipe-app python cli.py pipe day-recap --date 2026-04-20\nRunning pipe 'day-recap' for 2026-04-20...\nTraceback (most recent call last):\n File \"/app/cli.py\", line 245, in <module>\n cli()\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1161, in __call__\n return self.main(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1082, in main\n rv = self.invoke(ctx)\n ^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1697, in invoke\n return _process_result(sub_ctx.command.invoke(sub_ctx))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 1443, in invoke\n return ctx.invoke(self.callback, **ctx.params)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/click/core.py\", line 788, in invoke\n return __callback(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/cli.py\", line 225, in pipe\n result = run_pipe(pipe_id, target, pipes_dir=pipes_dir)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/app/consumers/pipes.py\", line 130, in run_pipe\n message = client.messages.create(\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_utils/_utils.py\", line 275, in wrapper\n return func(*args, **kwargs)\n ^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/resources/messages/messages.py\", line 953, in create\n return self._post(\n ^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1336, in post\n return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1013, in request\n return self._request(\n ^^^^^^^^^^^^^^\n File \"/usr/local/lib/python3.12/site-packages/anthropic/_base_client.py\", line 1117, in _request\n raise self._make_status_error_from_response(err.response) from None\nanthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'Your credit balance is too low to access the Anthropic API. Please go to Plans & Billing to upgrade or purchase credits.'}, 'request_id': 'req_011CaSonLU15vYJpDQyCCHmb'}\nAdm1n@DXP4800PLUS-B5F8:/volume1/screenpipe/app$","depth":26,"bounds":{"left":0.5674867,"top":0.7581804,"width":0.42220744,"height":0.046288908},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"The key works — it authenticated successfully. The error is just that your Anthropic account has no credits. Go to","depth":23,"bounds":{"left":0.57513297,"top":0.8292099,"width":0.22805852,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"console.anthropic.com → Plans & Billing","depth":24,"bounds":{"left":0.8031915,"top":0.8292099,"width":0.08610372,"height":0.011971269},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"and add some credits (a few dollars is enough for testing).","depth":23,"bounds":{"left":0.57513297,"top":0.8292099,"width":0.41589096,"height":0.02793296},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"Once topped up, rerun the same command and it should work.","depth":23,"bounds":{"left":0.57513297,"top":0.8619314,"width":0.12566489,"height":0.012769354},"on_screen":true,"role_description":"text"},{"role":"AXTextArea","text":"⌘ Esc to focus or unfocus Claude","depth":24,"bounds":{"left":0.6668883,"top":0.9082203,"width":0.22539894,"height":0.0311253},"on_screen":true,"value":"⌘ Esc to focus or unfocus Claude","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"⌘ Esc to focus or unfocus Claude","depth":26,"bounds":{"left":0.6715425,"top":0.91779727,"width":0.06781915,"height":0.011971269},"on_screen":true,"role_description":"text"}]...
|
5237734055032025378
|
3492635546011010965
|
idle
|
accessibility
|
NULL
|
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Explorer (⇧⌘E) - 1 unsaved file
1
Search (⇧⌘F)
Source Control (⌃⇧G) - 11 pending changes
11
Run and Debug (⇧⌘D)
Remote Explorer
Extensions (⇧⌘X) - 2 require update, 1 requires restart
3
Claude Code
Containers
EXPLORER
EXPLORER
Explorer Section: screenpipe [SSH: nas]
Explorer Section: screenpipe [SSH: nas]
SCREENPIPE [SSH: NAS]
#recycle
app
data
logs
pipes
.gitignore
app_settings.json
archive.db
archive.db-bak
U
archive.db.bak-pre-installid
db.sqlite
db.sqlite-shm
db.sqlite-wal
screenpipe_fts_migrate.sh
screenpipe_sync_updated.sh
U
screenpipe_sync.sh
M
screenpipe.db
Outline Section
OUTLINE
OUTLINE
Timeline Section
TIMELINE
TIMELINE
app_settings.json, Editor Group 1
screenpipe_sync.sh, Editor Group 1
screenpipe_fts_migrate.sh, Editor Group 1
screenpipe_sync_updated.sh, preview, Editor Group 1
pipe.md, Editor Group 1
.env, Editor Group 1
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
done
step "Reconciling NAS schema with source"
for tbl in "${ALL_SYNC_TABLES[@]}"; do
ensure_columns "$tbl"
done
run_sqlite_heredoc "creating indexes" "
ATTACH '$NAS_DB' AS nas;
-- vision
CREATE INDEX IF NOT EXISTS nas.idx_frames_timestamp ON frames(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_frames_app_name ON frames(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_window_name ON frames(window_name);
CREATE INDEX IF NOT EXISTS nas.idx_frames_video_chunk_id ON frames(video_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_frames_document_path ON frames(document_path) WHERE document_path IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_id ON elements(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_elements_frame_src_role ON elements(install_id, frame_id, source, role) WHERE text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_elements_onscreen_frame ON elements(install_id, frame_id) WHERE on_screen = 1 AND text IS NOT NULL;
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_timestamp ON ui_events(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_app_name ON ui_events(app_name);
CREATE INDEX IF NOT EXISTS nas.idx_ui_events_frame_id ON ui_events(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_ocr_text_frame_id ON ocr_text(install_id, frame_id);
CREATE INDEX IF NOT EXISTS nas.idx_meetings_start ON meetings(meeting_start);
CREATE INDEX IF NOT EXISTS nas.idx_video_chunks_device ON video_chunks(device_name);
-- audio
CREATE INDEX IF NOT EXISTS nas.idx_audio_chunks_timestamp ON audio_chunks(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_chunk_id ON audio_transcriptions(install_id, audio_chunk_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_timestamp ON audio_transcriptions(timestamp);
CREATE INDEX IF NOT EXISTS nas.idx_audio_trans_speaker ON audio_transcriptions(install_id, speaker_id, timestamp DESC);
CREATE INDEX IF NOT EXISTS nas.idx_speaker_emb_speaker_id ON speaker_embeddings(install_id, speaker_id);
CREATE INDEX IF NOT EXISTS nas.idx_audio_tags_chunk_id ON audio_tags(install_id, audio_chunk_id);
DETACH nas;
"
# ─── FTS TABLES (contentless, install-safe) ───────────────────────────────
run_sqlite_heredoc "creating FTS tables" "
ATTACH '$NAS_DB' AS nas;
CREATE VIRTUAL TABLE IF NOT EXISTS nas.frames_fts USING fts5(
full_text, app_name, window_name, browser_url,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.elements_fts USING fts5(
text, role,
install_id UNINDEXED, source_id UNINDEXED, frame_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.ui_events_fts USING fts5(
text_content, app_name, window_title, element_name,
install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
CREATE VIRTUAL TABLE IF NOT EXISTS nas.audio_transcriptions_fts USING fts5(
transcription, device,
speaker_id UNINDEXED, install_id UNINDEXED, source_id UNINDEXED,
tokenize='unicode61'
);
DETACH nas;
"
# ─── BUILD COLUMN LISTS ───────────────────────────────────────────────────
FRAMES_COLS=$(build_col_list frames)
ELEMENTS_COLS=$(build_col_list elements)
ELEMENTS_COLS_E=$(build_col_list elements e)
UI_EVENTS_COLS=$(build_col_list ui_events)
OCR_TEXT_COLS=$(build_col_list ocr_text)
OCR_TEXT_COLS_O=$(build_col_list ocr_text o)
VIDEO_CHUNKS_COLS=$(build_col_list video_chunks)
MEETINGS_COLS=$(build_col_list meetings)
ACHUNKS_COLS=$(build_col_list audio_chunks)
ATRANS_COLS=$(build_col_list audio_transcriptions)
ATRANS_COLS_T=$(build_col_list audio_transcriptions t)
SPEAKERS_COLS=$(build_col_list speakers)
SEMB_COLS=$(build_col_list speaker_embeddings)
ATAGS_COLS=$(build_col_list audio_tags)
ATAGS_COLS_AT=$(build_col_list audio_tags at)
TAGS_COLS=$(build_col_list tags)
VTAGS_COLS=$(build_col_list vision_tags)
VTAGS_COLS_VT=$(build_col_list vision_tags vt)
# ─── SYNC VISION DATA ─────────────────────────────────────────────────────
step "Syncing vision data for $TARGET_DATE"
run_sqlite_heredoc "video_chunks" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.video_chunks ($VIDEO_CHUNKS_COLS, install_id)
SELECT $VIDEO_CHUNKS_COLS, '$INSTALL_ID' FROM main.video_chunks
WHERE id IN (
SELECT DISTINCT video_chunk_id FROM main.frames
WHERE date(timestamp) = '$TARGET_DATE' AND video_chunk_id IS NOT NULL
);
DETACH nas;
"
run_sqlite_heredoc "frames ($SRC_FRAMES rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.frames ($FRAMES_COLS, install_id)
SELECT $FRAMES_COLS, '$INSTALL_ID' FROM main.frames WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ocr_text ($SRC_OCR rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ocr_text ($OCR_TEXT_COLS, install_id)
SELECT $OCR_TEXT_COLS_O, '$INSTALL_ID' FROM main.ocr_text o
JOIN main.frames f ON o.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "ui_events ($SRC_UI rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.ui_events ($UI_EVENTS_COLS, install_id)
SELECT $UI_EVENTS_COLS, '$INSTALL_ID' FROM main.ui_events WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "elements ($SRC_ELEMENTS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.elements ($ELEMENTS_COLS, install_id)
SELECT $ELEMENTS_COLS_E, '$INSTALL_ID' FROM main.elements e
JOIN main.frames f ON e.frame_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "meetings ($SRC_MEETINGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.meetings ($MEETINGS_COLS, install_id)
SELECT $MEETINGS_COLS, '$INSTALL_ID' FROM main.meetings WHERE date(meeting_start) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC AUDIO DATA ──────────────────────────────────────────────────────
step "Syncing audio data for $TARGET_DATE"
run_sqlite_heredoc "speakers ($SRC_SPEAKERS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speakers ($SPEAKERS_COLS, install_id)
SELECT $SPEAKERS_COLS, '$INSTALL_ID' FROM main.speakers;
DETACH nas;
"
run_sqlite_heredoc "speaker_embeddings ($SRC_SEMB rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.speaker_embeddings ($SEMB_COLS, install_id)
SELECT $SEMB_COLS, '$INSTALL_ID' FROM main.speaker_embeddings;
DETACH nas;
"
run_sqlite_heredoc "audio_chunks ($SRC_ACHUNKS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_chunks ($ACHUNKS_COLS, install_id)
SELECT $ACHUNKS_COLS, '$INSTALL_ID' FROM main.audio_chunks WHERE date(timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions ($SRC_ATRANS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_transcriptions ($ATRANS_COLS, install_id)
SELECT $ATRANS_COLS_T, '$INSTALL_ID' FROM main.audio_transcriptions t
JOIN main.audio_chunks c ON t.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
run_sqlite_heredoc "audio_tags ($SRC_ATAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.audio_tags ($ATAGS_COLS, install_id)
SELECT $ATAGS_COLS_AT, '$INSTALL_ID' FROM main.audio_tags at
JOIN main.audio_chunks c ON at.audio_chunk_id = c.id
WHERE date(c.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── SYNC SHARED ──────────────────────────────────────────────────────────
step "Syncing shared tables (tags, vision_tags)"
run_sqlite_heredoc "tags ($SRC_TAGS rows, all)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.tags ($TAGS_COLS, install_id)
SELECT $TAGS_COLS, '$INSTALL_ID' FROM main.tags;
DETACH nas;
"
run_sqlite_heredoc "vision_tags ($SRC_VTAGS rows)" "
ATTACH '$NAS_DB' AS nas;
INSERT OR IGNORE INTO nas.vision_tags ($VTAGS_COLS, install_id)
SELECT $VTAGS_COLS_VT, '$INSTALL_ID' FROM main.vision_tags vt
JOIN main.frames f ON vt.vision_id = f.id
WHERE date(f.timestamp) = '$TARGET_DATE';
DETACH nas;
"
# ─── FTS UPDATE (contentless, auto-rowid, no collisions) ──────────────────
# No `rowid` specified; SQLite assigns a fresh one. install_id + source_id
# are UNINDEXED columns so JOIN-back-to-base queries work.
step "Updating FTS indexes"
run_sqlite_heredoc "frames_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.frames_fts(full_text, app_name, window_name, browser_url, install_id, source_id)
SELECT full_text, app_name, window_name, browser_url, install_id, id
FROM nas.frames
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND full_text IS NOT NULL AND full_text != '';
DETACH nas;
"
run_sqlite_heredoc "elements_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.elements_fts(text, role, install_id, source_id, frame_id)
SELECT e.text, e.role, e.install_id, e.id, e.frame_id
FROM nas.elements e
JOIN nas.frames f ON e.frame_id = f.id AND e.install_id = f.install_id
WHERE date(f.timestamp) = '$TARGET_DATE'
AND e.install_id = '$INSTALL_ID'
AND e.text IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "ui_events_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.ui_events_fts(text_content, app_name, window_title, element_name, install_id, source_id)
SELECT text_content, app_name, window_title, element_name, install_id, id
FROM nas.ui_events
WHERE date(timestamp) = '$TARGET_DATE'
AND install_id = '$INSTALL_ID'
AND text_content IS NOT NULL;
DETACH nas;
"
run_sqlite_heredoc "audio_transcriptions_fts" "
ATTACH '$NAS_DB' AS nas;
INSERT INTO nas.audio_transcriptions_fts(transcription, device, speaker_id, install_id, source_id)
SELECT t.transcription, COALESCE(t.device,''), t.speaker_id, t.install_id, t.id
FROM nas.audio_transcriptions t
JOIN nas.audio_chunks c ON t.audio_chunk_id = c.id AND t.install_id = c.install_id
WHERE date(c.timestamp) = '$TARGET_DATE'
AND t.install_id = '$INSTALL_ID'
AND t.transcription IS NOT NULL AND t.transcription != '';
DETACH nas;
"
# ─── VERIFY ───────────────────────────────────────────────────────────────
step "Verifying DB"
V_FRAMES=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ELEMENTS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM elements WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_UI=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ui_events WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_OCR=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM ocr_text WHERE install_id='$INSTALL_ID' AND frame_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_MEETINGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM meetings WHERE date(meeting_start) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ACHUNKS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID';")
V_ATRANS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_transcriptions WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_ATAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM audio_tags WHERE install_id='$INSTALL_ID' AND audio_chunk_id IN (SELECT id FROM audio_chunks WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
V_VTAGS=$(sqlite3 "$NAS_DB" "SELECT COUNT(*) FROM vision_tags WHERE install_id='$INSTALL_ID' AND vision_id IN (SELECT id FROM frames WHERE date(timestamp) = '$TARGET_DATE' AND install_id='$INSTALL_ID');")
check "frames" "$V_FRAMES" "$SRC_FRAMES"
check "elements" "$V_ELEMENTS" "$SRC_ELEMENTS"
check "ui_events" "$V_UI" "$SRC_UI"
check "ocr_text" "$V_OCR" "$SRC_OCR"
check "meetings" "$V_MEETINGS" "$SRC_MEETINGS"
check "audio_chunks" "$V_ACHUNKS" "$SRC_ACHUNKS"
check "audio_transcriptions" "$V_ATRANS" "$SRC_ATRANS"
check "audio_tags" "$V_ATAGS" "$SRC_ATAGS"
check "vision_tags" "$V_VTAGS" "$SRC_VTAGS"
fi
# ─── COPY FRAME DATA FOLDER ──────────────────────────────────────────────────
step "Copying frame data folder for $TARGET_DATE"
if [ -d "$DATA_SRC" ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync frames → NAS"
rsync -a --ignore-existing "$DATA_SRC/" "$NAS_DATA/$TARGET_DATE/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_FILES=$(ls "$NAS_DATA/$TARGET_DATE" 2>/dev/null | grep -v '^audio$' | wc -l | tr -d ' ')
SRC_FILES=$(ls "$DATA_SRC" | wc -l | tr -d ' ')
COPIED_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE" | cut -f1)
if [ "$COPIED_FILES" -ge "$SRC_FILES" ]; then
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync frames → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_FILES" "$COPIED_SIZE" | tee -a "$LOG_FILE"
else
printf "\r %-40s ✗ %s / %s files\n" "rsync frames → NAS" "$COPIED_FILES" "$SRC_FILES" | tee -a "$LOG_FILE"
fi
else
printf " %-40s %s\n" "rsync frames → NAS" "skipped (no source dir)"
fi
# ─── COPY AUDIO FILES ────────────────────────────────────────────────────────
# Audio is flat in ~/.screenpipe/data/ with date in filename, e.g.
# System Audio (output)_2026-05-11_13-48-12.mp4
# soundcore AeroClip (input)_2026-05-10_11-10-32.mp4
# Mirror to $NAS_DATA/<date>/audio/ so each day's archive is self-contained.
step "Copying audio files for $TARGET_DATE"
shopt -s nullglob
AUDIO_FILES=( "$HOME/.screenpipe/data/"*_"${TARGET_DATE}"_*.mp4 )
shopt -u nullglob
if [ ${#AUDIO_FILES[@]} -gt 0 ]; then
mkdir -p "$NAS_DATA/$TARGET_DATE/audio"
RSYNC_START=$(date +%s)
printf " %-40s " "rsync audio → NAS"
rsync -a --ignore-existing "${AUDIO_FILES[@]}" "$NAS_DATA/$TARGET_DATE/audio/" 2>>"$LOG_FILE"
RSYNC_DUR=$(( $(date +%s) - RSYNC_START ))
COPIED_AUDIO=$(ls "$NAS_DATA/$TARGET_DATE/audio" | wc -l | tr -d ' ')
AUDIO_SIZE=$(du -sh "$NAS_DATA/$TARGET_DATE/audio" | cut -f1)
printf "\r %-40s ✓ %dm%02ds (%s files, %s)\n" \
"rsync audio → NAS" "$(( RSYNC_DUR / 60 ))" "$(( RSYNC_DUR % 60 ))" \
"$COPIED_AUDIO" "$AUDIO_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync audio → NAS" "skipped (no audio for date)"
fi
# ─── COPY LOGS ────────────────────────────────────────────────────────────────
step "Copying screenpipe logs for $TARGET_DATE"
NAS_LOGS="$NAS_MOUNT/logs"
mkdir -p "$NAS_LOGS"
shopt -s nullglob
LOG_FILES=( "$HOME/.screenpipe/screenpipe.$TARGET_DATE."*.log )
shopt -u nullglob
if [ ${#LOG_FILES[@]} -gt 0 ]; then
printf " %-40s " "rsync logs → NAS"
rsync -a "${LOG_FILES[@]}" "$NAS_LOGS/" 2>>"$LOG_FILE"
TOTAL_SIZE=$(du -ch "${LOG_FILES[@]}" | tail -1 | cut -f1)
printf "✓ %d file(s), %s\n" "${#LOG_FILES[@]}" "$TOTAL_SIZE" | tee -a "$LOG_FILE"
else
printf " %-40s %s\n" "rsync logs → NAS" "skipped (no matching logs)"
fi
# ─── SUMMARY ──────────────────────────────────────────────────────────────────
TOTAL_ELAPSED=$(( $(date +%s) - SCRIPT_START ))
DB_SIZE=$(du -sh "$NAS_DB" | cut -f1)
echo ""
log "Archive DB size: $DB_SIZE"
log "Total time: $(( TOTAL_ELAPSED / 60 ))m$(( TOTAL_ELAPSED % 60 ))s"
log "Sync complete for $TARGET_DATE (install $INSTALL_ID)"
log "========================================"
rsync -a "$HOME/.screenpipe/sync.log" "$NAS_LOGS/sync.log" 2>/dev/null || true
Implement and run pipe l…, Editor Group 2
remote SSH: nas
SSH: nas
screenpipe (Git) - master*, Checkout Branch/Tag...
master*
screenpipe (Git) - Synchronize Changes
No Problems
0
0
Forwarded Ports: 8766
1
Notifications
Sign In
Sign In
Shell Script
Editor Language Status: Inline Suggestions, next: $(copilot) No inline suggestion available, Inline suggestions
LF
UTF-8
Spaces: 2
Ln 846, Col 59
Info: Downloading VS Code Server...
Implement and run pipe logic
Session history
New session
Message actions
main.py
main.py
lets implement logic with pipes. how can I run it?
Thinking
Thinking
Let me look at the current project structure to understand what's already in place.
Bash
List project files
IN
find /volume1/screenpipe -type f | head -50 && echo "---" && ls /volume1/screenpipe
Copy code to clipboard
OUT
/volume1/screenpipe/.DS_Store
/volume1/screenpipe/screenpipe.db
/volume1/screenpipe/screenpipe_sync.sh
/volume1/screenpipe/app_settings.json
/volume1/screenpipe/.gitignore
/volume1/screenpipe/archive.db
/volume1/screenpipe/db.sqlite
/volume1/screenpipe/db.sqlite-wal
/volume1/screenpipe/db.sqlite-shm
/volume1/screenpipe/#recycle/desktop.ini
/volume1/screenpipe/#recycle/db.sqlite
/volume1/screenpipe/#recycle/Copy #1 of db.sqlite
/volume1/screenpipe/#recycle/.DS_Store
/volume1/screenpipe/#recycle/Copy #2 of db.sqlite
/volume1/screenpipe/#recycle/archive.db
/volume1/screenpipe/#recycle/Copy #1 of archive.db
/volume1/screenpipe/#recycle/Copy #2 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of archive.db
/volume1/screenpipe/#recycle/Copy #4 of archive.db
/volume1/screenpipe/#recycle/Copy #5 of archive.db
/volume1/screenpipe/#recycle/Copy #3 of db.sqlite
/volume1/screenpipe/#recycle/Copy #4 of db.sqlite
/volume1/screenpipe/#recycle/Copy #6 of archive.db
/volume1/screenpipe/#recycle/test.txt
/volume1/screenpipe/#recycle/Copy #7 of archive.db
/volume1/screenpipe/#recycle/Copy #8 of archive.db
/volume1/screenpipe/#recycle/archive.db-journal
/volume1/screenpipe/#recycle/Copy #1 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #2 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #3 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #4 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #6 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #7 of archive.db-journal
/volume1/screenpipe/#recycle/Copy #5 of db.sqlite
/volume1/screenpipe/pipes/.DS_Store
/volume1/screenpipe/app/.env
/volume1/screenpipe/app/cli.py
/volume1/screenpipe/app/.DS_Store
/volume1/screenpipe/app/db.py
/volume1/screenpipe/app/docker-compose.yml
/volume1/screenpipe/app/main.py
/volume1/screenpipe/app/requirements.txt
/volume1/screenpipe/app/Dockerfile
/volume1/screenpipe/data/.DS_Store
/volume1/screenpipe/.git/description
/volume1/screenpipe/.git/HEAD
/volume1/screenpipe/.git/index
/volume1/screenpipe/.git/COMMIT_EDITMSG
/volume1/screenpipe/#recycle/data/.DS_Store
---
app
app_settings.json
archive.db
data
db.sqlite
db.sqlite-shm
db.sqlite-wal
pipes
#recycle
screenpipe.db
screenpipe_sync.sh
Read
main.py
main.py
Bash
Check pipes directory and docker-compose
IN
ls /volume1/screenpipe/pipes/ && ls /volume1/screenpipe/app/ && cat /volume1/screenpipe/app/docker-compose.yml
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
cli.py
consumers
db.py
docker-compose.yml
Dockerfile
main.py
__pycache__
requirements.txt
static
services:
screenpipe-app:
build: .
container_name: screenpipe-app
restart: unless-stopped
ports:
- "8766:8000"
volumes:
- /volume1/screenpipe:/data
env_file:
- .env
environment:
TZ: Europe/Sofia
DB_PATH: /data/db.sqlite
sqlite-web-archive:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-archive
restart: unless-stopped
ports:
- "8767:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/archive.db"]
sqlite-web-live:
image: ghcr.io/coleifer/sqlite-web:latest
container_name: screenpipe-sqlweb-live
restart: unless-stopped
ports:
- "8768:8080"
volumes:
- /volume1/screenpipe:/data
command: ["-H", "[IP_ADDRESS]", "-r", "/data/db.sqlite"]
Read
requirements.txt
requirements.txt
Bash
Inspect a pipe directory
IN
ls /volume1/screenpipe/pipes/day-recap/ && cat /volume1/screenpipe/pipes/day-recap/pipe.json 2>/dev/null || ls /volume1/screenpipe/pipes/day-recap/
Copy code to clipboard
OUT
pipe.md
pipe.md
Read
cli.py
cli.py
Bash
List all pipes and their contents
IN
ls /volume1/screenpipe/pipes/ && for d in /volume1/screenpipe/pipes/*/; do echo "=== $d ==="; ls "$d"; done
Copy code to clipboard
OUT
ai-habits
day-recap
meeting-summary
standup-update
time-breakdown
video-export
=== /volume1/screenpipe/pipes/ai-habits/ ===
pipe.md
=== /volume1/screenpipe/pipes/day-recap/ ===
pipe.md
=== /volume1/screenpipe/pipes/meeting-summary/ ===
pipe.md
=== /volume1/screenpipe/pipes/standup-update/ ===
pipe.md
=== /volume1/screenpipe/pipes/time-breakdown/ ===
pipe.md
=== /volume1/screenpipe/pipes/video-export/ ===
pipe.md
Bash
Read pipe markdown files
IN
cat /volume1/screenpipe/pipes/day-recap/pipe.md && echo "===" && cat /volume1/screenpipe/pipes/meeting-summary/pipe.md 2>/dev/null | head -50
Copy code to clipboard
OUT
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
Thinking
Thinking
Bash
Read summary consumer
IN
ls /volume1/screenpipe/app/consumers/ && cat /volume1/screenpipe/app/consumers/summary.py
Copy code to clipboard
OUT
activity.py
audio.py
elements.py
__init__.py
interactions.py
ocr.py
__pycache__
report.py
summary.py
"""AI summary generator using Claude."""
import os
from datetime import date
from typing import Any
from consumers.activity import app_time, summary_stats, browser_urls, ui_event_summary
from consumers.ocr import deduplicated_text
from consumers.audio import formatted_transcript
SUMMARY_TYPES = {
"day_recap": {
"title": "Day Recap",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a concise day recap using EXACTLY this format:
## Summary
One sentence: what I mainly worked on today.
## Accomplishments
- Top 3 things I finished, with approximate times
- Name specific apps, files, or projects
## Key Moments
- Important things seen or heard, with timestamps
## Unfinished Work
- What to continue tomorrow
## Patterns
- Apps used most, topics that came up repeatedly
Only report what you can verify from the data. End with:
**Next step:** [most important thing to continue]""",
},
"standup": {
"title": "Standup Update",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
## Audio/speech:
{audio}
Write a brief standup update:
**Yesterday:** What I worked on (2-3 bullets)
**Today:** What I plan to continue (1-2 bullets)
**Blockers:** Any issues observed (or "None")
Keep it under 150 words. Only report what's verifiable from the data.""",
},
"focus_time": {
"title": "Focus & Distraction Analysis",
"prompt": """\
You are analyzing a person's computer activity for the day.
## App usage (minutes per app):
{app_time}
## Browser URLs visited:
{browser_urls}
## UI activity per app (clicks / keystrokes / app-switches):
{ui_events}
## Screen content (sampled every 5 minutes):
{ocr_text}
Analyze focus vs distraction patterns:
## Deep Work Periods
- When and how long were sustained focus sessions?
- What was being worked on?
## Distractions
- Which apps/sites were used recreationally?
- How much time was lost to context switching?
## Recommendations
- 2-3 concrete suggestions to improve focus tomorrow
Be specific with times and app names.""",
},
}
def _build_context(for_date: date) -> dict[str, str]:
apps = app_time(for_date)
app_lines = "\n".join(f"- {a['app_name']}: {a['minutes']} min" for a in apps[:20])
urls = browser_urls(for_date, limit=20)
url_lines = "\n".join(
f"- {u['browser_url'][:100]} ({u['minutes']} min)" for u in urls
)
ui_rows = ui_event_summary(for_date)
ui_lines = "\n".join(
f"- {r['app_name']}: {r['clicks']} clicks, {r['keystrokes']} keys, {r['switches']} switches"
for r in ui_rows[:15]
)
ocr_rows = deduplicated_text(for_date, chunk_minutes=5)
ocr_lines = "\n".join(
f"[{r['bucket']}] {r['app_name']} / {r['window_name'] or ''}: {r['text'][:200]}"
for r in ocr_rows[:100]
)
audio = formatted_transcript(for_date)
return {
"app_time": app_lines or "(no app data)",
"browser_urls": url_lines or "(no browser data)",
"ui_events": ui_lines or "(no UI event data)",
"ocr_text": ocr_lines or "(no screen data)",
"audio": audio[:3000] if len(audio) > 3000 else audio,
}
def generate(
summary_type: str = "day_recap",
for_date: date | None = None,
api_key: str | None = None,
) -> dict[str, Any]:
"""Generate an AI summary. Returns dict with 'title', 'content', 'date'."""
import anthropic
d = for_date or date.today()
key = api_key or os.environ.get("ANTHROPIC_API_KEY", "")
if not key:
return {
"title": "Error",
"content": "ANTHROPIC_API_KEY not set. Add it to your .env file.",
"date": str(d),
}
spec = SUMMARY_TYPES.get(summary_type)
if not spec:
return {"title": "Error", "content": f"Unknown summary type: {summary_type}", "date": str(d)}
stats = summary_stats(d)
if stats["total_frames"] == 0:
return {
"title": spec["title"],
"content": f"No screen data found for {d}.",
"date": str(d),
}
ctx = _build_context(d)
prompt = spec["prompt"].format(**ctx)
client = anthropic.Anthropic(api_key=key)
message = client.messages.create(
model="claude-haiku-4-5-20251001",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}],
)
return {
"title": spec["title"],
"content": message.content[0].text,
"date": str(d),
"stats": stats,
}
Thinking
Thinking
Bash
Read all pipe.md files
IN
for f in /volume1/screenpipe/pipes/*/pipe.md; do echo "=== $f ==="; cat "$f"; echo; done
Copy code to clipboard
OUT
=== /volume1/screenpipe/pipes/ai-habits/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: AI Habits
description: "How you use AI tools — patterns and insights"
icon: "🤖"
featured: true
---
Search my recordings from the last 24 hours for AI tool usage. Use app_name filter for each tool separately: ChatGPT, Claude, Copilot, Cursor, Gemini, Perplexity. Use limit=5 per search, max 6 searches total.
Read screenpipe skill first.
Use this exact format:
## AI Tools Used
- List each tool with approximate time spent (e.g. "Claude: ~45min")
## What I Used Them For
- For each tool: coding, writing, research, or brainstorming
## Usage Patterns
- Do I switch between tools? Use them in bursts or steadily?
## Effectiveness
- Which tool appeared alongside completed work vs. abandoned attempts
If no AI usage is found, say so clearly. End with: "**Tip:** [one suggestion to use AI tools more effectively]"
=== /volume1/screenpipe/pipes/day-recap/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Day Recap
description: "Today's accomplishments, key moments, and unfinished work"
icon: "📋"
featured: true
---
Analyze my screen and audio recordings from today (last 16 hours only).
Read screenpipe skill first.
Use this exact format:
## Summary
One sentence: what I mainly did today.
## Accomplishments
- Top 3 things I finished, with timestamps (e.g. "2:30 PM")
- Name specific apps, files, or projects
## Key Moments
- Important things I saw, said, or heard — with timestamps
## Unfinished Work
- What I should continue tomorrow — name the app/file/task
## Patterns
- Apps I used most, topics that came up repeatedly
Only report what you can verify from the data. End with: "**Next step:** [most important thing to continue]"
=== /volume1/screenpipe/pipes/meeting-summary/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Meeting Summary
description: "Summarize meeting transcript with key takeaways and action items"
icon: "🤝"
featured: false
---
Summarize the meeting transcript provided in the context. Include key takeaways and action items. If the meeting is marked as ongoing, note that and summarize what's available so far.
Read screenpipe skill first.
Use this exact format:
## Meeting Summary
One sentence: what this meeting was about.
## Key Takeaways
- Top 3-5 important points discussed
- Include who said what when relevant
## Action Items
- [ ] Task — assigned to whom, deadline if mentioned
- [ ] Task — assigned to whom
## Decisions Made
- List any decisions or agreements reached
## Open Questions
- Anything unresolved or needing follow-up
Keep it concise and actionable.
=== /volume1/screenpipe/pipes/standup-update/pipe.md ===
---
schedule: manual
enabled: true
template: true
title: Standup Update
de...
|
26644
|
NULL
|
NULL
|
NULL
|