code_notebook_cell_latest (view) Content

01MFY5UWFAL26PQN4ERU Documentation rssd-init Bootstrap SQL -- Complete bootstrap SQL generated using Drizzle ORM -- Session state and views are generated at the top level of bootstrap -- All business logic views are defined in ../universal/views.ts using Drizzle query builder f3f0b4e4dec23397251e9a10f22bcff6c9dd37ec Bootstrap SQL for history/documentation purposes 2025-10-24 12:25:28
01MFY5UWFB0EK6T798GL SQL ConstructionSqlNotebook session_ephemeral_table -- Session state ephemeral table is created at the top level of bootstrap -- This ensures it's available for all subsequent operations 57f63cd30d47d0ddd7b3342d4f66e5681a07acdb Creates a session_state_ephemeral table for session arguments 2025-10-24 12:25:28
01MFY5UWFB0T3G6LQZ31 SQL osQuery Management Server (Prime) Installed Linux software SELECT name AS name, version AS version, ' AS source FROM python_packages; b650542e7386bc1c4f5665b3c3ecf89d698e0403 Get all software installed on a Linux computer, including browser plugins and installed packages. Note that this does not include other running processes in the processes table. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["linux"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFB15F4MY7HCL SQL osQuery Management Server (Prime) System Information SELECT * FROM system_info 16cc9b141b5e3a1b60906bd4cb62ac9398960134 System information for identification. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["darwin","windows","linux"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFB7L3GFBZSIP SQL ConstructionSqlNotebook v001_once_initialDDL -- Service tables DDL would go here -- This is equivalent to the original v001_once_initialDDL method 87cdcbd0753d06c53a5064d164b7af3786423c30 Creates all service tables to initialize an RSSD (once_ pragma means it will only be run once in the database by surveilr) 2025-10-24 12:25:28
01MFY5UWFB83528ELV5E AI LLM Prompt rssd-init understand notebooks schema Understand the following structure of an SQLite database designed to store code notebooks and execution kernels. The database comprises three main tables: 'code_notebook_kernel', 'code_notebook_cell', and 'code_notebook_state'. 1. 'code_notebook_kernel': Stores different types of execution kernels (SQL, Documentation, AI LLM Prompt, etc.) 2. 'code_notebook_cell': Stores the actual code cells with their interpretable code and metadata 3. 'code_notebook_state': Tracks changes in the state of each cell for migration and execution tracking The relationships are as follows: - Each cell in 'code_notebook_cell' is associated with a kernel in 'code_notebook_kernel'. - The 'code_notebook_state' table tracks changes in the state of each cell, linking back to the 'code_notebook_cell' table. This system allows for versioned, trackable, and executable code notebooks with full provenance tracking. 631587d4dfdd618b7e04322b4fc2ad9c9ac57542 Prepares a prompt that will allow the user to teach an LLM about this project's code notebooks schema 2025-10-24 12:25:28
01MFY5UWFBA2I7G1WARN AI LLM Prompt rssd-init understand service schema TODO: add table and column descriptions into migratableSQL to help LLMs understand the service schema and generate appropriate SQL queries. 5eaed05dc6f3e964ddba13eb08dcc05f8be66754 Prepares a prompt that will allow the user to teach an LLM about this project's service schema 2025-10-24 12:25:28
01MFY5UWFBCM46P0V2TO SQL osQuery Management Server (Prime) OS Version (Linux and Macos) SELECT * FROM os_version; a1e080c2148910f2759c2f26cffe3b6702cbb36f Get OS version for identification. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["linux","darwin"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFBFRHBCP8WWV SQL osQuery Management Server (Prime) osquery-ms Boundary (Linux and Macos) SELECT DISTINCT value, key FROM process_envs WHERE key='SURVEILR_OSQUERY_BOUNDARY'; 60b8b75382b3f448b8d7b12e74ed4dd598dde45e Get the boundary for a node. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["linux","darwin"],"singleton":true} 2025-10-24 12:25:28
01MFY5UWFBGQJJ3CBYKX SQL osQuery Management Server (Prime) Network Interfaces (Linux and Macos) SELECT * FROM interface_details; 8c4ddeef6d5bfa771e7f09c0ef6efe607a1aa5c5 Get network interfaces for identification. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["linux","darwin"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFBI7EOAZNJVL SQL osQuery Management Server (Prime) Installed Macos software SELECT name AS name, bundle_short_version AS version, ' AS source FROM homebrew_packages; 7d6e973d51c710421c03d5e90d02cbfecb4a5047 Get all software installed on a Macos computer, including browser plugins and installed packages. Note that this does not include other running processes in the processes table. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["darwin"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFBKR4QACAJJY SQL osQuery Management Server (Prime) osquery-ms Boundary (Windows) SELECT DISTINCT value, variable FROM default_environment WHERE variable='SURVEILR_OSQUERY_BOUNDARY'; c00e47a212d24e153372d5e232d0044502deeee3 Get the boundary for a node. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["windows"],"singleton":true} 2025-10-24 12:25:28
01MFY5UWFBOHJVRG027L SQL osQuery Management Server (Prime) Network Interfaces (Windows) SELECT * FROM interface_details; 8c4ddeef6d5bfa771e7f09c0ef6efe607a1aa5c5 Get network interfaces for identification. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["windows"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFBORBSRDPP95 SQL ConstructionSqlNotebook v001_seedDML INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('ignore .git and node_modules paths', 'default', '/(.git|node_modules)/', 'IGNORE_RESOURCE', NULL, NULL, 'Ignore any entry with `/.git/` or `/node_modules/` in the path.', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('images-metadata', 'default', '.(?P<nature>jpg|jpeg|png|gif|bmp|tiff|svg|webp)$', 'CONTENT_ACQUIRABLE | CONTENT_ACQUIRABLE_METADATA', '?P<nature>', NULL, 'Images with metadata extraction', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('jsonl-content-replace', 'default', '.(?P<nature>jsonl)$', 'CONTENT_ACQUIRABLE | CONTENT_REPLACE_JSON_LINES', '?P<nature>', NULL, 'JSONL files with content replacement', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('media-metadata', 'default', '.(?P<nature>mp4|mp3)$', 'CONTENT_ACQUIRABLE | CONTENT_ACQUIRABLE_METADATA', '?P<nature>', NULL, 'Media files with metadata extraction', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('pdf-docx-transform-metadata', 'default', '.(?P<nature>pdf|docx)$', 'CONTENT_ACQUIRABLE | CONTENT_ACQUIRABLE_TRANSFORM_MARKITDOWN | CONTENT_ACQUIRABLE_METADATA', '?P<nature>', NULL, 'PDF and DOCX documents with full transformation and metadata extraction', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('surveilr-SQL capturable executable', 'default', 'surveilr-SQL', 'CAPTURABLE_EXECUTABLE | CAPTURABLE_SQL', NULL, NULL, 'Any entry with surveilr-SQL in the path will be treated as a capturable SQL executable and allow execution of the SQL', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('surveilr-[NATURE] style capturable executable', 'default', 'surveilr[(?P<nature>[^]]*)]', 'CAPTURABLE_EXECUTABLE', '?P<nature>', NULL, 'Any entry with surveilr-[XYZ] in the path will be treated as a capturable executable extracting XYZ as the nature', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_match_rule" ("ur_ingest_resource_path_match_rule_id", "namespace", "regex", "flags", "nature", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log") VALUES ('typical ingestion extensions', 'default', '.(?P<nature>md|mdx|html|json|jsonc|puml|txt|toml|yml|xml|tap|csv|tsv|ssv|psv|tm7)$', 'CONTENT_ACQUIRABLE', '?P<nature>', NULL, 'Ingest the content for text and structured data extensions. Assume the nature is the same as the extension.', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL) ON CONFLICT(ur_ingest_resource_path_match_rule_id) DO NOTHING; ; INSERT INTO "ur_ingest_resource_path_rewrite_rule" ( "ur_ingest_resource_path_rewrite_rule_id", "namespace", "regex", "replace", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( '.plantuml -> .puml', 'default', '(\\.plantuml)$', '.puml', NULL, 'Treat .plantuml as .puml files', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL ) ON CONFLICT(ur_ingest_resource_path_rewrite_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_rewrite_rule" ( "ur_ingest_resource_path_rewrite_rule_id", "namespace", "regex", "replace", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( '.text -> .txt', 'default', '(\\.text)$', '.txt', NULL, 'Treat .text as .txt files', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL ) ON CONFLICT(ur_ingest_resource_path_rewrite_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_rewrite_rule" ( "ur_ingest_resource_path_rewrite_rule_id", "namespace", "regex", "replace", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( '.yaml -> .yml', 'default', '(\\.yaml)$', '.yml', NULL, 'Treat .yaml as .yml files', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL ) ON CONFLICT(ur_ingest_resource_path_rewrite_rule_id) DO NOTHING; INSERT INTO "ur_ingest_resource_path_rewrite_rule" ( "ur_ingest_resource_path_rewrite_rule_id", "namespace", "regex", "replace", "priority", "description", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( '.ndjson -> .jsonl', 'default', '(\\.ndjson)$', '.jsonl', NULL, 'Treat .ndjson as .jsonl files', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL ) ON CONFLICT(ur_ingest_resource_path_rewrite_rule_id) DO NOTHING; ; INSERT INTO "party_type" ( "party_type_id", "code", "value", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( '01' || upper(substr(hex(randomblob(10)), 1, 25)), 'ORGANIZATION', 'Organization', NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ON CONFLICT DO NOTHING; INSERT INTO "party_type" ( "party_type_id", "code", "value", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( '01' || upper(substr(hex(randomblob(10)), 1, 25)), 'PERSON', 'Person', NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ON CONFLICT DO NOTHING; ; INSERT INTO "orchestration_nature" ( "orchestration_nature_id", "nature", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( 'surveilr-transform-csv', 'Transform CSV', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL ) ON CONFLICT(orchestration_nature_id) DO NOTHING; INSERT INTO "orchestration_nature" ( "orchestration_nature_id", "nature", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( 'surveilr-transform-xml', 'Transform XML', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL ) ON CONFLICT(orchestration_nature_id) DO NOTHING; INSERT INTO "orchestration_nature" ( "orchestration_nature_id", "nature", "elaboration", "created_at", "created_by", "updated_at", "updated_by", "deleted_at", "deleted_by", "activity_log" ) VALUES ( 'surveilr-transform-html', 'Transform HTML', NULL, CURRENT_TIMESTAMP, 'SYSTEM', NULL, NULL, NULL, NULL, NULL ) ON CONFLICT(orchestration_nature_id) DO NOTHING; ; INSERT INTO "uniform_resource_graph" ("name", "elaboration") VALUES ('filesystem', '{}') ON CONFLICT(name) DO NOTHING; INSERT INTO "uniform_resource_graph" ("name", "elaboration") VALUES ('imap', '{}') ON CONFLICT(name) DO NOTHING; INSERT INTO "uniform_resource_graph" ("name", "elaboration") VALUES ('plm', '{}') ON CONFLICT(name) DO NOTHING; INSERT INTO "uniform_resource_graph" ("name", "elaboration") VALUES ('osquery-ms', '{}') ON CONFLICT(name) DO NOTHING; 738b42724df1b185521020729f85307c5d2c0d05 Seed data which provides default configuration for surveilr app 2025-10-24 12:25:28
01MFY5UWFBR4J9E5EL91 SQL osQuery Management Server (Prime) Installed Windows software SELECT name AS name, version AS version, ' AS source FROM chocolatey_packages; f248d4270e5cdda0a641d8111dd38e4e09f26d8e Get all software installed on a Windows computer, including browser plugins and installed packages. Note that this does not include other running processes in the processes table. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["windows"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFBUQV84I8EBE SQL ConstructionSqlNotebook surveilr_table_size CREATE TABLE IF NOT EXISTS surveilr_table_size ( table_name TEXT PRIMARY KEY, table_size_mb REAL ); DELETE FROM surveilr_table_size; INSERT INTO surveilr_table_size (table_name, table_size_mb) SELECT name, ROUND(SUM(pgsize) / (1024.0 * 1024), 2) FROM dbstat GROUP BY name; c9cccd9cce30f7a471cd1d28e306a0324570c20f Creates a surveilr_table_size to compute the sizes for individual tables for statistical purposes. 2025-10-24 12:25:28
01MFY5UWFC2LYP15QLIQ SQL osQuery Management Server (Prime) Server Uptime SELECT * FROM uptime LIMIT 1; 5deb02948d93120fa7fc1493ebfcc1d8cb058cac Get server uptime for monitoring. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["linux","darwin","windows"],"singleton":true} 2025-10-24 12:25:28
01MFY5UWFC3DRS51CAVK SQL osQuery Management Server (Policy) Full disk encryption enabled (Macos) SELECT DISTINCT value, key FROM process_envs WHERE key=''; a8e30bc01781c86908dedf05dc180eb2260c426b Check if full disk encryption is enabled on Macos systems. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["darwin"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCBXHZ76PWGC SQL osQuery Management Server (Policy) Full disk encryption enabled (Windows) SELECT DISTINCT value, variable FROM default_environment WHERE variable=''; b65d0a70555f150ca8a84d58fe7d213ead2ad437 Check if full disk encryption is enabled on Windows systems. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["windows"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCFVHO285UE7 Text Asset (.puml) rssd-init surveilr-service-erd.auto.puml @startuml surveilr-service-erd !define TABLE(name,desc) class name as "desc" << (T,#FFAAAA) >> TABLE(device, "Device") TABLE(party, "Party") TABLE(organization, "Organization") @enduml 7fe53c06552bb90647a06283fb8d74e6e7ba7cf2 ERD diagram for surveilr service schema 2025-10-24 12:25:28
01MFY5UWFCI1S8YGW31C SQL osQuery Management Server (Prime) Listening Ports SELECT p.name, p.path FROM listening_ports l JOIN processes p USING (pid); e8bf48851505286fbe16ae3e60e090fa76d44e9a Get listening ports for security monitoring. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["darwin","windows","linux"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCIDK5S5XW6J SQL osQuery Management Server (Policy) SSH keys encrypted SELECT * FROM users e9e19fac540eec4a59c5f12011f012b46295cbd7 Check if SSH keys are properly encrypted. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["darwin","windows","linux"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCJDRXSTPY7F SQL ConstructionSqlNotebook auto_generate_console_content_tabular_sqlpage_files -- Auto-generate console content for all tables and views -- This recreates the original auto-generation system using Drizzle -- Delete existing auto-generated files DELETE FROM sqlpage_files WHERE path like 'console/content/table/%.auto.sql'; DELETE FROM sqlpage_files WHERE path like 'console/content/view/%.auto.sql'; -- Generate table browser pages for every table INSERT OR REPLACE INTO sqlpage_files (path, contents) SELECT 'console/content/table/' || name || '.auto.sql', 'SELECT ' || quote('dynamic') || ' AS component, sqlpage.run_sql(' || quote('shell/shell.sql') || ') AS properties; SELECT ' || quote('breadcrumb') || ' AS component; SELECT ''Home'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/'' AS link; SELECT ''Console'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console'' AS link; SELECT ''Content'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content'' AS link; SELECT ''' || name || ' table'' as title, ''#'' AS link; SELECT ' || quote('title') || ' AS component, ''' || name || ' (table) Content'' as contents; SET total_rows = (SELECT COUNT(*) FROM ' || name || '); SET limit = COALESCE($limit, 50); SET offset = COALESCE($offset, 0); SET total_pages = ($total_rows + $limit - 1) / $limit; SET current_page = ($offset / $limit) + 1; SELECT ''text'' AS component, ''[' || name || ' (table) Schema](console/info-schema/table.sql?name=' || name || '&stats=yes)'' AS contents_md; SELECT ''text'' AS component, ''- Start Row: '' || $offset || '' '' || ''- Rows per Page: '' || $limit || '' '' || ''- Total Rows: '' || $total_rows || '' '' || ''- Current Page: '' || $current_page || '' '' || ''- Total Pages: '' || $total_pages as contents_md WHERE $stats IS NOT NULL; -- Display table with pagination SELECT ' || quote('table') || ' AS component, TRUE AS sort, TRUE AS search, TRUE AS hover, TRUE AS striped_rows, TRUE AS small; SELECT * FROM ' || name || ' LIMIT $limit OFFSET $offset; SELECT ''text'' AS component, (SELECT CASE WHEN $current_page > 1 THEN ''[Previous](?limit='' || $limit || ''&offset='' || ($offset - $limit) || '')'' ELSE '''' END) || '' '' || ''(Page '' || $current_page || '' of '' || $total_pages || '') '' || (SELECT CASE WHEN $current_page < $total_pages THEN ''[Next](?limit='' || $limit || ''&offset='' || ($offset + $limit) || '')'' ELSE '''' END) AS contents_md;' FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' AND name NOT IN ('sqlpage_files', 'sqlpage_aide_navigation'); -- Generate view browser pages for every view INSERT OR REPLACE INTO sqlpage_files (path, contents) SELECT 'console/content/view/' || name || '.auto.sql', 'SELECT ' || quote('dynamic') || ' AS component, sqlpage.run_sql(' || quote('shell/shell.sql') || ') AS properties; SELECT ' || quote('breadcrumb') || ' AS component; SELECT ''Home'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/'' AS link; SELECT ''Console'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console'' AS link; SELECT ''Content'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content'' AS link; SELECT ''' || name || ' view'' as title, ''#'' AS link; SELECT ' || quote('title') || ' AS component, ''' || name || ' (view) Content'' as contents; SET total_rows = (SELECT COUNT(*) FROM ' || name || '); SET limit = COALESCE($limit, 50); SET offset = COALESCE($offset, 0); SET total_pages = ($total_rows + $limit - 1) / $limit; SET current_page = ($offset / $limit) + 1; SELECT ''text'' AS component, ''[' || name || ' (view) Schema](console/info-schema/view.sql?name=' || name || '&stats=yes)'' AS contents_md; SELECT ''text'' AS component, ''- Start Row: '' || $offset || '' '' || ''- Rows per Page: '' || $limit || '' '' || ''- Total Rows: '' || $total_rows || '' '' || ''- Current Page: '' || $current_page || '' '' || ''- Total Pages: '' || $total_pages as contents_md WHERE $stats IS NOT NULL; -- Display view with pagination SELECT ' || quote('table') || ' AS component, TRUE AS sort, TRUE AS search, TRUE AS hover, TRUE AS striped_rows, TRUE AS small; SELECT * FROM ' || name || ' LIMIT $limit OFFSET $offset; SELECT ''text'' AS component, (SELECT CASE WHEN $current_page > 1 THEN ''[Previous](?limit='' || $limit || ''&offset='' || ($offset - $limit) || '')'' ELSE '''' END) || '' '' || ''(Page '' || $current_page || '' of '' || $total_pages || '') '' || (SELECT CASE WHEN $current_page < $total_pages THEN ''[Next](?limit='' || $limit || ''&offset='' || ($offset + $limit) || '')'' ELSE '''' END) AS contents_md;' FROM sqlite_master WHERE type = 'view'; -- Generate redirect files from .sql to .auto.sql INSERT OR IGNORE INTO sqlpage_files (path, contents) SELECT 'console/content/table/' || name || '.sql', 'SELECT ''redirect'' AS component,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content/table/' || name || '.auto.sql'' AS link WHERE $stats IS NULL; SELECT ''redirect'' AS component,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content/table/' || name || '.auto.sql?stats='' || $stats AS link WHERE $stats IS NOT NULL;' FROM sqlite_master WHERE type = 'table' AND name NOT LIKE 'sqlite_%' AND name NOT IN ('sqlpage_files', 'sqlpage_aide_navigation'); INSERT OR IGNORE INTO sqlpage_files (path, contents) SELECT 'console/content/view/' || name || '.sql', 'SELECT ''redirect'' AS component,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content/view/' || name || '.auto.sql'' AS link WHERE $stats IS NULL; SELECT ''redirect'' AS component,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content/view/' || name || '.auto.sql?stats='' || $stats AS link WHERE $stats IS NOT NULL;' FROM sqlite_master WHERE type = 'view'; e79b80796b3c784b5c503c325c6c0f8fdc9401d0 A series of idempotent INSERT statements which will auto-generate "default" content for all tables and views 2025-10-24 12:25:28
01MFY5UWFCK1TE637BEA Text Asset (.puml) rssd-init surveilr-code-notebooks-erd.auto.puml @startuml surveilr-code-notebooks-erd !define TABLE(name,desc) class name as "desc" << (T,#FFAAAA) >> !define ENUM(name,desc) enum name as "desc" << (E,#FFFFAA) >> TABLE(code_notebook_kernel, "Code Notebook Kernel") TABLE(code_notebook_cell, "Code Notebook Cell") TABLE(code_notebook_state, "Code Notebook State") code_notebook_kernel ||--o{ code_notebook_cell : kernel_id code_notebook_cell ||--o{ code_notebook_state : cell_id @enduml e234f1fcc38250c46bc48eccc74cf9dda3c6813c ERD diagram for surveilr code notebooks 2025-10-24 12:25:28
01MFY5UWFCN190Y1AD6E SQL osQuery Management Server (Prime) Available Disk Space (Linux and Macos) SELECT * FROM mounts; f6381159e2290e1234386ced28080022ced1d77a Get available disk space for monitoring. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["linux","darwin"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCQGXNYVVWIH SQL osQuery Management Server (Policy) Full disk encryption enabled (Linux) SELECT DISTINCT value, key FROM process_envs WHERE key=''; a8e30bc01781c86908dedf05dc180eb2260c426b Check if full disk encryption is enabled on Linux systems. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["linux"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCRQCM1DPHKF SQL osQuery Management Server (Prime) Available Disk Space (Windows) SELECT * FROM logical_drives; d0fb57dab51d2f1d9efd002bf8b9cdf386ea650b Get available disk space for monitoring. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["windows"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCSOXJWLK1EY Text Asset (.rs) rssd-init models_polygenix.rs // Rust models for surveilr polygenix integration // TODO: Generate actual Rust models from Drizzle schema pub struct Device { pub device_id: String, pub device_name: String, } pub struct Party { pub party_id: String, pub party_name: String, } bbcc883775f44d1064375104a4debfc88c2f0d34 Rust models for polygenix integration 2025-10-24 12:25:28
01MFY5UWFCZAWMN5Q9LB SQL osQuery Management Server (Prime) Users SELECT * FROM users e9e19fac540eec4a59c5f12011f012b46295cbd7 Get users for security monitoring. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["darwin","windows","linux"],"singleton":false} 2025-10-24 12:25:28
01MFY5UWFCZOAUPHD7A8 SQL osQuery Management Server (Prime) OS Version (Windows) SELECT * FROM os_version; a1e080c2148910f2759c2f26cffe3b6702cbb36f Get OS version for identification. {"osquery-ms-interval":60,"results-uniform-resource-store-jq-filters":["del(.calendarTime, .unixTime, .action, .counter)"],"results-uniform-resource-captured-jq-filters":["{calendarTime, unixTime}"],"targets":["windows"],"singleton":false} 2025-10-24 12:25:28
web-ui.auto_generate_console_content_tabular_sqlpage_files SQL Web UI auto_generate_console_content_tabular_sqlpage_files -- code provenance: `ConsoleSqlPages.infoSchemaContentDML` (file:///app/www.surveilr.com/lib/std/web-ui-content/console.ts) -- the "auto-generated" tables will be in '*.auto.sql' with redirects DELETE FROM sqlpage_files WHERE path like 'console/content/table/%.auto.sql'; DELETE FROM sqlpage_files WHERE path like 'console/content/view/%.auto.sql'; INSERT OR REPLACE INTO sqlpage_files (path, contents) SELECT 'console/content/' || tabular_nature || '/' || tabular_name || '.auto.sql', 'SELECT ''dynamic'' AS component, sqlpage.run_sql(''shell/shell.sql'') AS properties; SELECT ''breadcrumb'' AS component; SELECT ''Home'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/'' AS link; SELECT ''Console'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console'' AS link; SELECT ''Content'' as title,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content'' AS link; SELECT ''' || tabular_name || ' ' || tabular_nature || ''' as title, ''#'' AS link; SELECT ''title'' AS component, ''' || tabular_name || ' (' || tabular_nature || ') Content'' as contents; SET total_rows = (SELECT COUNT(*) FROM ' || tabular_name || '); SET limit = COALESCE($limit, 50); SET offset = COALESCE($offset, 0); SET total_pages = ($total_rows + $limit - 1) / $limit; SET current_page = ($offset / $limit) + 1; SELECT ''text'' AS component, ''' || info_schema_link_full_md || ''' AS contents_md SELECT ''text'' AS component, ''- Start Row: '' || $offset || '' '' || ''- Rows per Page: '' || $limit || '' '' || ''- Total Rows: '' || $total_rows || '' '' || ''- Current Page: '' || $current_page || '' '' || ''- Total Pages: '' || $total_pages as contents_md WHERE $stats IS NOT NULL; -- Display uniform_resource table with pagination SELECT ''table'' AS component, TRUE AS sort, TRUE AS search, TRUE AS hover, TRUE AS striped_rows, TRUE AS small; SELECT * FROM ' || tabular_name || ' LIMIT $limit OFFSET $offset; SELECT ''text'' AS component, (SELECT CASE WHEN $current_page > 1 THEN ''[Previous](?limit='' || $limit || ''&offset='' || ($offset - $limit) || '')'' ELSE '''' END) || '' '' || ''(Page '' || $current_page || '' of '' || $total_pages || '') '' || (SELECT CASE WHEN $current_page < $total_pages THEN ''[Next](?limit='' || $limit || ''&offset='' || ($offset + $limit) || '')'' ELSE '''' END) AS contents_md;' FROM console_content_tabular; INSERT OR IGNORE INTO sqlpage_files (path, contents) SELECT 'console/content/' || tabular_nature || '/' || tabular_name || '.sql', 'SELECT ''redirect'' AS component,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content/' || tabular_nature || '/' || tabular_name || '.auto.sql'' AS link WHERE $stats IS NULL; ' || 'SELECT ''redirect'' AS component,sqlpage.environment_variable(''SQLPAGE_SITE_PREFIX'') || ''/console/content/' || tabular_nature || '/' || tabular_name || '.auto.sql?stats='' || $stats AS link WHERE $stats IS NOT NULL;' FROM console_content_tabular; -- TODO: add ${this.upsertNavSQL(...)} if we want each of the above to be navigable through DB rows TODO A series of idempotent INSERT statements which will auto-generate "default" content for all tables and views 2025-10-24 12:25:28