Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
refactor(api): derive Socket.IO inventory without a manifest (#5515)
[._.]/ Adam Eivy598b69c51a4c
diff --git a/client/src/pages/VoiceCallHost.jsx b/client/src/pages/VoiceCallHost.jsxindex 10b46b1917..339500f91a 100644--- a/client/src/pages/VoiceCallHost.jsx+++ b/client/src/pages/VoiceCallHost.jsx@@ -199,7 +199,7 @@ export default function VoiceCallHost() {audio.current = { context, stream, node, source, outputId: output?.deviceId ?? null, pending: [] };// Two literal emits, not a computed event name — a computed// `socket.emit(x ? 'a' : 'b')` is invisible to the static- // socket-event-catalog scan (`scripts/generate-socket-event-catalog.js`),+ // socket-event inventory scan (`server/lib/socketEventInventory.js`),// which greps for `socket.emit('literal')`.if (currentMode === 'call') socket.emit('voice:call:attach');else socket.emit('voice:capture:start');diff --git a/docs/API.md b/docs/API.mdindex 0cc87667fe..93b2f9f270 100644--- a/docs/API.md+++ b/docs/API.md@@ -24,9 +24,9 @@ and the current-vs-proposed boundary.- `GET /api/api-docs/asyncapi.json` — AsyncAPI 3 for the Socket.IO transport.- `GET /api/api-docs/tools.min.json` — the minimized semantic tool resource: only the operations annotated `x-portos-tool`, flattened to provider-neutral tool records with an HTTP binding. Sized for an agent to read whole, unlike the full internal document.-Generated entries are explicitly marked `generated` until a runtime-backed payload contract exists; detailed entries are marked `modeled`. Regenerate the checked-in route and event manifests with `npm run generate:api-docs`. Drift tests fail when source declarations and committed manifests diverge.+Inferred entries are explicitly marked `generated` until a runtime-backed payload contract exists; detailed entries are marked `modeled`. Regenerate the checked-in HTTP route manifest with `npm run generate:api-docs`. Socket.IO events are derived from source on first use and cached for the server process, so event declarations have no checked-in manifest or regeneration step.-When adding an HTTP route, keep its request Zod schema in a reusable server library and register the detailed documentation in `server/lib/apiOperationContracts.js`; the route and OpenAPI should consume the same schema object. Add an `x-portos-tool` annotation to that contract entry to also publish the operation as an agent-callable tool in `tools.min.json`, and declare the codes its error responses really throw in `x-portos-error-codes` — the HTTP status alone does not identify the code, since `errorHandler` prefers an explicit `err.code` over the status map. Socket payload schemas follow the same pattern in `server/lib/socketEventContracts.js`. The generators guarantee inventory coverage, while these small registries make richer contracts incremental without maintaining a second handwritten list of paths or events.+When adding an HTTP route, keep its request Zod schema in a reusable server library and register the detailed documentation in `server/lib/apiOperationContracts.js`; the route and OpenAPI should consume the same schema object. Add an `x-portos-tool` annotation to that contract entry to also publish the operation as an agent-callable tool in `tools.min.json`, and declare the codes its error responses really throw in `x-portos-error-codes` — the HTTP status alone does not identify the code, since `errorHandler` prefers an explicit `err.code` over the status map. Socket payload schemas follow the same pattern in `server/lib/socketEventContracts.js`. The HTTP generator and live Socket.IO source inventory guarantee coverage, while these small registries make richer contracts incremental without maintaining a second handwritten list of paths or events.Building a native companion client? See [COMPANION_APP_API.md](./COMPANION_APP_API.md) — the stable, pre-auth-discoverable contract (discovery/identity, HTTP Basic auth, instance management, palette actions, daily-log, POST progress, and the iCloud-sync precedent) that the PortDeck app consumes.@@ -685,7 +685,7 @@ Every mounted API prefix (see `server/index.js` for the authoritative list). DomConnect to Socket.IO at `http://localhost:5555`.-The complete generated event list is visible in **API Explorer → Event API** and available at `GET /api/api-docs/asyncapi.json` as AsyncAPI 3. The examples below highlight common flows rather than serving as the exhaustive inventory.+The complete source-derived event list is visible in **API Explorer → Event API** and available at `GET /api/api-docs/asyncapi.json` as AsyncAPI 3. The examples below highlight common flows rather than serving as the exhaustive inventory.### Log Streamingdiff --git a/docs/API_TOOL_CONTRACT.md b/docs/API_TOOL_CONTRACT.mdindex 4250b30b51..9152597e3e 100644--- a/docs/API_TOOL_CONTRACT.md+++ b/docs/API_TOOL_CONTRACT.md@@ -12,31 +12,33 @@ job and confirmation extensions retained in the [unified design spec](./superpowThe current source contains:-- 145 mounted HTTP prefixes, 2,069 deduplicated HTTP operations, and 2,072+- 146 mounted HTTP prefixes, 2,138 deduplicated HTTP operations, and 2,141route declarations in `server/lib/apiRouteCatalog.generated.json`.-- 103 Socket.IO source files and 253 events in- `server/lib/socketEventCatalog.generated.json`.+- A Socket.IO inventory derived from server and client call sites on first use,+ then cached for the lifetime of the server process.- 22 provider-neutral semantic tools: one `cos.create-task` tool and 21semantic adapters inherited from the voice registry.- Five read-only context tools on the Agent Tools MCP transport. The MCPtransport may additionally advertise the 21 semantic adapters when itsseparate read/write grants are enabled.-The generated route catalog and event catalog are the exhaustive maps. The-in-app API Explorer and the following endpoints expose them at runtime:+The generated route catalog is the exhaustive HTTP map. Socket.IO events are+derived directly from their source declarations, so there is no second checked-in+event manifest to regenerate. The in-app API Explorer and the following endpoints+expose both inventories at runtime:| Surface | Endpoint | Contract ||---|---|---|| HTTP inventory | `GET /api/api-docs/catalog.json` | Searchable route metadata, domains, access classification, side-effect classification, and modeled/generated status. || Internal HTTP spec | `GET /api/api-docs/internal/openapi.json` | OpenAPI 3.0.3 for every mounted HTTP operation. Generated operations have path parameters and a default response; modeled operations add richer contracts. || Public HTTP spec | `GET /api/api-docs/openapi.json` | OpenAPI 3.0.3 for only APIs exposed through Settings → API Access. |-| Socket.IO inventory | `GET /api/api-docs/events.json` | Searchable event names, direction, source, and payload-contract status. |+| Socket.IO inventory | `GET /api/api-docs/events.json` | Searchable event names, direction, and payload-contract status. || Socket.IO spec | `GET /api/api-docs/asyncapi.json` | AsyncAPI 3 document for the Socket.IO transport. || HTTP tool resource | `GET /api/api-docs/tools.min.json` | Minimized provider-neutral records for the operations annotated `x-portos-tool`, with an HTTP binding and declared failure codes. Schemas are JSON Schema, sized for an agent to read whole. |-Run `npm run generate:api-docs` after route or event declarations change. The-generated manifests are source-derived artifacts; they are not a second-handwritten endpoint list.+Run `npm run generate:api-docs` after HTTP route declarations change. Socket.IO+event declarations require no regeneration; the server derives and caches their+inventory from source.## Endpoint map@@ -288,9 +290,9 @@ result path in `server/services/cosToolRegistry.js`, and## Validation- `node scripts/generate-api-route-catalog.js` — regenerated deterministic- HTTP manifest: 2,069 operations / 2,072 declarations / 145 mounts.-- `node scripts/generate-socket-event-catalog.js` — deterministic 253-event- Socket.IO manifest.+ HTTP manifest: 2,138 operations / 2,141 declarations / 146 mounts.+- `server/lib/socketEventInventory.test.js` — source-derived Socket.IO inventory,+ representative-event coverage, direction normalization, and runner-tree exclusion.- Focused Vitest execution was attempted but this isolated worktree has noinstalled `server/node_modules` (`vitest: command not found`). No livedatabase, provider, MCP client, or personal records were used.diff --git a/docs/superpowers/specs/2026-08-27-unified-cos-tool-calling-interface.md b/docs/superpowers/specs/2026-08-27-unified-cos-tool-calling-interface.mdindex 5c63844866..51605fd3cc 100644--- a/docs/superpowers/specs/2026-08-27-unified-cos-tool-calling-interface.md+++ b/docs/superpowers/specs/2026-08-27-unified-cos-tool-calling-interface.md@@ -13,8 +13,8 @@ Audience: PortOS server, Persistent Mind, voice, palette, and future agent integThe initial production slice is implemented. This section supersedes proposal language elsewhere in the document when the two differ.-- The generated HTTP inventory contains 2,067 mounted operations and feeds `GET /api/api-docs/catalog.json` plus the complete OpenAPI 3.1 document at `/api/api-docs/internal/openapi.json`.-- A generated inventory of 253 Socket.IO events feeds `/api/api-docs/events.json` and the AsyncAPI 3 document at `/api/api-docs/asyncapi.json`.+- The generated HTTP inventory contains 2,138 mounted operations and feeds `GET /api/api-docs/catalog.json` plus the complete OpenAPI 3.0.3 document at `/api/api-docs/internal/openapi.json`.+- A source-derived Socket.IO inventory feeds `/api/api-docs/events.json` and the AsyncAPI 3 document at `/api/api-docs/asyncapi.json`; it is cached per server process and has no checked-in event manifest.- `/api/cos/tools` exposes 22 provider-neutral tools: one Persistent Mind task tool plus 21 semantic voice adapters. The `mind` scope can see all 22 when granted; the `agent`, `ui`, and `voice` scopes can see the 21 semantic adapters. OpenAI, Anthropic, and MCP translations derive from the same entries.- `/api/cos/tools/call` and `/api/cos/tools/calls/:requestId` implement server-derived UI authority, schema validation, normalized results, and replay conflict detection. Raw routes are not callable.- Persistent Mind has separate default-off read, write, and CoS-task grants and a bounded multi-round tool loop. `cos.create-task` reuses the existing scheduler, worktree, review, CI, and landing-policy path.diff --git a/package.json b/package.jsonindex 5e514749ae..efe443278f 100644--- a/package.json+++ b/package.json@@ -14,7 +14,7 @@"dev": "node scripts/checkNodeVersion.js && node scripts/checkNpmVersion.js && node scripts/dev-start.js","dev:stop": "node ./node_modules/pm2/bin/pm2 stop ecosystem.config.cjs","eval:agent-context": "node scripts/agent-context-eval.js",- "generate:api-docs": "node scripts/generate-api-route-catalog.js && node scripts/generate-socket-event-catalog.js",+ "generate:api-docs": "node scripts/generate-api-route-catalog.js","build": "npm run build --prefix client","start": "node scripts/checkNodeVersion.js && node scripts/checkNpmVersion.js && node scripts/ensure-deps.js && npm run build && node scripts/setup-db.js && node scripts/setup-cert.js && (node ./node_modules/pm2/bin/pm2 delete ecosystem.config.cjs --silent || echo pm2 delete skipped) && node ./node_modules/pm2/bin/pm2 start ecosystem.config.cjs && node ./node_modules/pm2/bin/pm2 save","pm2:start": "node ./node_modules/pm2/bin/pm2 start ecosystem.config.cjs",diff --git a/scripts/generate-socket-event-catalog.js b/scripts/generate-socket-event-catalog.jsdeleted file mode 100644index 74dd0dd6fe..0000000000--- a/scripts/generate-socket-event-catalog.js+++ /dev/null@@ -1,134 +0,0 @@-#!/usr/bin/env node-/** Generate a deterministic Socket.IO event inventory from server and client call sites. */--import { readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';-import { dirname, join, relative, resolve, sep } from 'node:path';-import { fileURLToPath } from 'node:url';-import { isDirectlyInvoked } from './lib/directInvocation.js';--const HERE = dirname(fileURLToPath(import.meta.url));-export const REPO_ROOT = resolve(HERE, '..');-export const MANIFEST_RELATIVE_PATH = 'server/lib/socketEventCatalog.generated.json';-export const REGENERATE_COMMAND = 'node scripts/generate-socket-event-catalog.js';--const SERVER_ROOT = 'server';-const CLIENT_ROOT = 'client/src';-const EXCLUDED_DIRECTORY_NAMES = new Set(['node_modules', 'coverage', 'dist']);-const EXCLUDED_SERVER_PREFIXES = Object.freeze(['server/cos-runner/']);-const SOCKET_CALL_RE = /\bsocket\??\.(on|once|emit)\(\s*(`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/g;-const SERVER_EMIT_RE = /\b(?:io|ioInstance)\??\.emit\(\s*(`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/g;-const SERVER_BROADCAST_RE = /\bbroadcastTo(?!Set\b)[A-Za-z]*\(\s*(`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/g;-const REGISTER_SUBSCRIBER_RE = /\bregisterSubscriber\(\s*socket\s*,\s*(['"])([^'"\n]+)\1/g;--const toPosix = (path) => path.split(sep).join('/');-const sourceLineFor = (source, index) => source.slice(0, index).split('\n').length;--const walk = (path) => statSync(path).isDirectory()- ? readdirSync(path)- .filter((name) => !EXCLUDED_DIRECTORY_NAMES.has(name))- .flatMap((name) => walk(join(path, name)))- : [path];--const sourceFiles = (repoRoot) => [- ...walk(join(repoRoot, SERVER_ROOT)),- ...walk(join(repoRoot, CLIENT_ROOT)),-].filter((path) => {- const relativePath = toPosix(relative(repoRoot, path));- return /\.(?:js|jsx)$/.test(path)- && !path.endsWith('.test.js')- && !path.endsWith('.test.jsx')- && !EXCLUDED_SERVER_PREFIXES.some((prefix) => relativePath.startsWith(prefix));-});--const parseEventExpression = (expression) => {- const quote = expression[0];- const body = expression.slice(1, -1);- if (quote !== '`') return body;- if (/\$\{(?![A-Za-z_$][\w$]*\})/.test(body)) return null;- const normalized = body.replace(/\$\{([A-Za-z_$][\w$]*)\}/g, '{$1}');- // A leading placeholder is an internal helper pattern (for example- // `${namespace}:subscribed`), not a callable address. Concrete call sites- // and registerSubscriber expansion contribute the real event names.- return normalized.startsWith('{') ? null : normalized;-};--const directionFor = ({ side, method }) => {- if (side === 'server') return method === 'emit' ? 'server-to-client' : 'client-to-server';- return method === 'emit' ? 'client-to-server' : 'server-to-client';-};--export function scanSocketEventFile(filePath, repoRoot = REPO_ROOT) {- const source = readFileSync(filePath, 'utf8');- const path = toPosix(relative(repoRoot, filePath));- const side = path.startsWith('server/') ? 'server' : 'client';- const evidence = [];- const record = (match, method, expression = match[2]) => {- const event = parseEventExpression(expression);- if (!event) return;- evidence.push({ event, direction: directionFor({ side, method }), source: path, line: sourceLineFor(source, match.index) });- };-- for (const match of source.matchAll(SOCKET_CALL_RE)) record(match, match[1]);- if (side === 'server') {- for (const match of source.matchAll(SERVER_EMIT_RE)) record(match, 'emit', match[1]);- for (const match of source.matchAll(SERVER_BROADCAST_RE)) record(match, 'emit', match[1]);- for (const match of source.matchAll(REGISTER_SUBSCRIBER_RE)) {- for (const suffix of ['subscribe', 'unsubscribe']) {- evidence.push({ event: `${match[2]}:${suffix}`, direction: 'client-to-server', source: path, line: sourceLineFor(source, match.index) });- }- for (const suffix of ['subscribed', 'unsubscribed']) {- evidence.push({ event: `${match[2]}:${suffix}`, direction: 'server-to-client', source: path, line: sourceLineFor(source, match.index) });- }- }- }- return evidence;-}--export function buildSocketEventCatalog({ repoRoot = REPO_ROOT } = {}) {- const byEvent = new Map();- for (const filePath of sourceFiles(repoRoot)) {- for (const evidence of scanSocketEventFile(filePath, repoRoot)) {- const entry = byEvent.get(evidence.event) || { event: evidence.event, directions: new Set(), sources: new Map() };- entry.directions.add(evidence.direction);- entry.sources.set(`${evidence.direction}:${evidence.source}:${evidence.line}`, {- direction: evidence.direction,- source: evidence.source,- line: evidence.line,- });- byEvent.set(evidence.event, entry);- }- }-- const events = [...byEvent.values()].map((entry) => ({- event: entry.event,- directions: [...entry.directions].sort(),- sources: [...entry.sources.values()].sort((a, b) =>- a.source.localeCompare(b.source) || a.line - b.line || a.direction.localeCompare(b.direction)),- })).sort((a, b) => a.event.localeCompare(b.event));- const sourceCount = new Set(events.flatMap((event) => event.sources.map((source) => source.source))).size;- return {- schemaVersion: 1,- generatedFrom: ['server/**/*.js', '!server/cos-runner/**', 'client/src/**/*.{js,jsx}'],- events,- stats: {- events: events.length,- clientToServer: events.filter((event) => event.directions.includes('client-to-server')).length,- serverToClient: events.filter((event) => event.directions.includes('server-to-client')).length,- bidirectional: events.filter((event) => event.directions.length > 1).length,- sourceFiles: sourceCount,- },- };-}--export const serializeSocketEventCatalog = (catalog) => `${JSON.stringify(catalog, null, 2)}\n`;-export const readSocketEventCatalog = (repoRoot = REPO_ROOT) => JSON.parse(- readFileSync(join(repoRoot, MANIFEST_RELATIVE_PATH), 'utf8'),-);--function main() {- const catalog = buildSocketEventCatalog();- writeFileSync(join(REPO_ROOT, MANIFEST_RELATIVE_PATH), serializeSocketEventCatalog(catalog), 'utf8');- console.log(`🔌 Wrote ${MANIFEST_RELATIVE_PATH}: ${catalog.stats.events} Socket.IO events across ${catalog.stats.sourceFiles} source files`);-}--if (isDirectlyInvoked(import.meta.url)) main();diff --git a/scripts/generate-socket-event-catalog.test.js b/scripts/generate-socket-event-catalog.test.jsdeleted file mode 100644index 4ff45fd8cc..0000000000--- a/scripts/generate-socket-event-catalog.test.js+++ /dev/null@@ -1,82 +0,0 @@-import { describe, expect, it } from 'vitest';-import { mkdirSync, mkdtempSync, readFileSync, writeFileSync } from 'node:fs';-import { join } from 'node:path';-import { tmpdir } from 'node:os';-import {- MANIFEST_RELATIVE_PATH,- REGENERATE_COMMAND,- REPO_ROOT,- buildSocketEventCatalog,- readSocketEventCatalog,- scanSocketEventFile,- serializeSocketEventCatalog,-} from './generate-socket-event-catalog.js';--const write = (root, path, source) => {- const target = join(root, path);- mkdirSync(join(target, '..'), { recursive: true });- writeFileSync(target, source, 'utf8');-};--describe('Socket.IO event catalog scanner', () => {- it('merges client/server evidence and normalizes bounded template events', () => {- const root = mkdtempSync(join(tmpdir(), 'portos-socket-catalog-'));- write(root, 'server/services/socket.js', `- socket.on('demo:start', handler);- io.emit('demo:done', data);- io?.emit('demo:optional', data);- socket.emit(\`demo:step:\${kind}\`, data);- `);- write(root, 'server/sockets/empty.js', 'export default {};');- write(root, 'client/src/demo.jsx', `- socket.emit('demo:start', {});- socket.on('demo:done', handler);- `);- const catalog = buildSocketEventCatalog({ repoRoot: root });- expect(catalog.events.find((event) => event.event === 'demo:start').directions).toEqual(['client-to-server']);- expect(catalog.events.find((event) => event.event === 'demo:done').sources).toHaveLength(2);- expect(catalog.events.map((event) => event.event)).toContain('demo:optional');- expect(catalog.events.map((event) => event.event)).toContain('demo:step:{kind}');- });-- it('does not classify client lifecycle listeners as outbound calls', () => {- const root = mkdtempSync(join(tmpdir(), 'portos-socket-file-'));- write(root, 'client/src/socket.js', `socket.on('connect', handler); socket.emit('shell:start', {});`);- expect(scanSocketEventFile(join(root, 'client/src/socket.js'), root)).toEqual([- expect.objectContaining({ event: 'connect', direction: 'server-to-client' }),- expect.objectContaining({ event: 'shell:start', direction: 'client-to-server' }),- ]);- });-});--describe('generated Socket.IO event catalog', () => {- it('matches a fresh source scan', () => {- const stale = `${MANIFEST_RELATIVE_PATH} is stale — run \`${REGENERATE_COMMAND}\` and commit the result.`;- const fresh = buildSocketEventCatalog();- expect(fresh, stale).toEqual(readSocketEventCatalog());- expect(readFileSync(join(REPO_ROOT, MANIFEST_RELATIVE_PATH), 'utf8'), stale)- .toBe(serializeSocketEventCatalog(fresh));- });-- it('is a unique all-source inventory with representative lifecycle events', () => {- const catalog = readSocketEventCatalog();- expect(catalog.stats.events).toBeGreaterThan(100);- expect(new Set(catalog.events.map((event) => event.event)).size).toBe(catalog.events.length);- const names = new Set(catalog.events.map((event) => event.event));- for (const event of [- 'cos:mind:event',- 'cos:subscribe',- 'voice:text',- 'shell:start',- 'image-gen:completed',- 'error:occurred',- 'backup:failed',- 'calendar:sync:started',- 'digital-twin:test-progress',- 'sharing:inbox-updated',- ]) {- expect(names.has(event), event).toBe(true);- }- expect(catalog.events.flatMap((event) => event.sources).some((source) => source.source.startsWith('server/cos-runner/'))).toBe(false);- });-});diff --git a/server/lib/README.md b/server/lib/README.mdindex c2dd8f1caf..cf53e3746a 100644--- a/server/lib/README.md+++ b/server/lib/README.md@@ -26,6 +26,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub| `appDeployFlags.js` | Shared allowlist of flags PortOS may forward to a managed app's `deploy.sh`, consumed by socket validation and deployment orchestration without reversing the lib/services dependency. || `apiContractSchemas.js` | Canonical Zod request contracts for externally callable APIs plus `zodToOpenApiSchema` (plain JSON Schema — the 3.0.3 conversion happens at the OpenAPI document boundary, not here); runtime routes and OpenAPI use the same schema objects. || `socketEventContracts.js` | Runtime-backed payload contracts for modeled inbound Socket.IO events, reusing the same Zod schemas as live validation. |+| `socketEventInventory.js` | Cached source-derived Socket.IO event inventory: event names and directions only, with no checked-in manifest or positional source metadata. || `agentContextValidation.js` | Shared settings, MCP request/tool input/output schemas, result + approximate-token bounds, source-freshness status, and `advertiseAgentContextTools(scopes)` for the opt-in read-only agent-context surface. || `validation.js` | Catch-all Zod schemas (app/process/provider, social accounts, GitHub, backup/sharing, document/legacy-export) + the `validateRequest` middleware + shared helpers (`optionalBooleanMap`, `isSafeRecordId`, `parseIndexParam`, `parsePagination`). Re-exports the per-domain validation files below so existing deep imports keep working. || `taskDataInputCatalog.js` | Pure catalog and persisted ids for deterministic context sources that scheduled agent tasks can preload before dispatch. |@@ -420,7 +421,7 @@ The barrel `server/lib/index.js` is a machine-checkable enumeration of every pub|---|---|| `apiAccessPolicy.js` | Shared always-public path and gated non-`/api` prefix policy consumed by both `authGate` and API discovery. || `apiCatalog.js` | Searchable projection of the generated Express route manifest: domain, access, side-effect, contract coverage, summaries, and Express-to-OpenAPI path conversion. |-| `socketEventCatalog.js` | Searchable projection of the generated Socket.IO call-site manifest: direction, domain, source evidence, and runtime-schema coverage. |+| `socketEventCatalog.js` | Searchable projection of the cached Socket.IO inventory: direction, domain, and runtime-schema coverage. || `apiOperationContracts.js` | Detailed operation metadata for intentionally public APIs. It consumes the canonical route Zod contracts and feeds both public and internal OpenAPI documents. || `apiRegistry.js` | Single source of truth for which PortOS services are externally-callable HTTP APIs (`voice`, `sdapi`). `API_REGISTRY` declares each API's `publicPrefixes` (read/compute-safe surface only) + defaults; `isRegistryPublic(settings, path)` tells `authGate` when an `exposed && !requireAuth` API re-opens its prefix; `resolveApiAccess(settings)` merges persisted `apiAccess` flags for the Settings UI + OpenAPI docs. || `arrayUtils.js` | `shuffle(arr)` — Fisher-Yates shuffle (new array, never mutates). The canonical uniform shuffle — never `arr.sort(() => Math.random() - 0.5)`, which is biased. Shared by `meatspacePostCognitive.js` (Schulte table / mental rotation) and `meatspacePostMemory.js` (memory drill generators). |diff --git a/server/lib/asyncApiSpec.js b/server/lib/asyncApiSpec.jsindex 8fa7dc2f0f..23b82d54bc 100644--- a/server/lib/asyncApiSpec.js+++ b/server/lib/asyncApiSpec.js@@ -1,4 +1,4 @@-/** AsyncAPI 3 document for PortOS's generated Socket.IO event catalog. */+/** AsyncAPI 3 document for PortOS's source-derived Socket.IO event catalog. */import { buildSocketEventCatalog } from './socketEventCatalog.js';@@ -30,8 +30,8 @@ const channelParameters = (address) => Object.fromEntries(]),);-export const buildAsyncApiSpec = ({ baseUrl, version = '0.0.0' } = {}) => {- const catalog = buildSocketEventCatalog();+export const buildAsyncApiSpec = async ({ baseUrl, version = '0.0.0' } = {}) => {+ const catalog = await buildSocketEventCatalog();const channels = {};const operations = {};const messages = {};@@ -48,7 +48,6 @@ export const buildAsyncApiSpec = ({ baseUrl, version = '0.0.0' } = {}) => {summary: `${direction} payload for ${event.event}.`,payload: schema,'x-portos-contract-status': event.modeledDirections.includes(direction) ? 'modeled' : 'generated',- 'x-portos-source': event.sources.filter((source) => source.direction === direction),};channelMessages[messageId] = { $ref: `#/components/messages/${messageId}` };const operationId = identifier(`${direction}_${event.event}`);@@ -75,7 +74,7 @@ export const buildAsyncApiSpec = ({ baseUrl, version = '0.0.0' } = {}) => {info: {title: 'PortOS Socket.IO API',version,- description: 'Generated event inventory for the PortOS Socket.IO transport. Generated payloads remain explicitly marked until backed by a runtime schema.',+ description: 'Source-derived event inventory for the PortOS Socket.IO transport. Inferred payloads remain explicitly marked until backed by a runtime schema.',},defaultContentType: 'application/json',servers: { local: serverDefinition(baseUrl) },diff --git a/server/lib/asyncApiSpec.test.js b/server/lib/asyncApiSpec.test.jsindex d0ecd6346e..3374293420 100644--- a/server/lib/asyncApiSpec.test.js+++ b/server/lib/asyncApiSpec.test.js@@ -2,8 +2,8 @@ import { describe, expect, it } from 'vitest';import { buildAsyncApiSpec } from './asyncApiSpec.js';describe('AsyncAPI spec', () => {- it('builds AsyncAPI 3 channels and direction-aware operations from the socket catalog', () => {- const spec = buildAsyncApiSpec({ baseUrl: 'https://portos.example.test', version: '1.2.3' });+ it('builds AsyncAPI 3 channels and direction-aware operations from the socket catalog', async () => {+ const spec = await buildAsyncApiSpec({ baseUrl: 'https://portos.example.test', version: '1.2.3' });expect(spec.asyncapi).toBe('3.0.0');expect(spec.info.version).toBe('1.2.3');expect(spec.servers.local).toMatchObject({ host: 'portos.example.test', protocol: 'socket.io', pathname: '/socket.io' });@@ -12,10 +12,11 @@ describe('AsyncAPI spec', () => {expect(Object.values(spec.operations).some((operation) => operation.action === 'send')).toBe(true);expect(Object.values(spec.operations).some((operation) => operation.action === 'receive')).toBe(true);expect(Object.values(spec.components.messages).some((message) => message['x-portos-contract-status'] === 'modeled')).toBe(true);+ expect(Object.values(spec.components.messages).every((message) => !('x-portos-source' in message))).toBe(true);});- it('declares every dynamic channel address parameter', () => {- const spec = buildAsyncApiSpec({ baseUrl: 'http://example.com', version: '1.2.3' });+ it('declares every dynamic channel address parameter', async () => {+ const spec = await buildAsyncApiSpec({ baseUrl: 'http://example.com', version: '1.2.3' });for (const channel of Object.values(spec.channels)) {const names = [...channel.address.matchAll(/\{([A-Za-z_$][\w$]*)\}/g)].map((match) => match[1]);expect(Object.keys(channel.parameters || {}).sort()).toEqual([...new Set(names)].sort());diff --git a/server/lib/auditCatalog.js b/server/lib/auditCatalog.jsindex 5303b356df..5889bef9b4 100644--- a/server/lib/auditCatalog.js+++ b/server/lib/auditCatalog.js@@ -13,8 +13,8 @@ const filing = ({ slugPrefix, label, issueLabel, labelDescription, noun }) => Oblabel,issueLabel,labelDescription,- planItemBody: `From the \`${label}\` audit of <slice> (<today's date>). <What is wrong, 1–2 sentences.> Fix: <files + functions in {appName}>. Scope: <small/medium/large>.`,- bodyRequirements: `the slice audited and the date, what is wrong with file:line references, the user-visible impact, a concrete proposed fix naming the files in {appName}, and a \`Scope:\` of small/medium/large`,+ planItemBody: `From the \`${label}\` audit of <slice> (<today's date>). Problem: <what is wrong, 1–2 sentences>. Impact: <runtime, data, CI/release, or recurring maintenance consequence>. Fix: <files + functions in {appName}>. Scope: <small/medium/large>.`,+ bodyRequirements: `the slice audited and the date, what is wrong with file:line references, the concrete impact (runtime, data, CI/release, or recurring maintenance), a proposed fix naming the files in {appName}, and a \`Scope:\` of small/medium/large`,planCommitMessage: `docs(${issueLabel}): propose <N> ${noun}`,});@@ -37,11 +37,11 @@ Your deliverable is tracker items, not code. The run must end with the same \`gi## How to run this audit1. **Pick a bounded slice and say so first.** Do NOT attempt the whole repository. Choose one coherent area (a feature directory, a route group, a handful of related screens) — prefer one that recent audit issues have not already covered — and open your report by naming the slice in one line.-2. **Read the actual code.** Every finding must cite \`path/to/file.js:LINE\` and describe a concrete, reproducible failure: what a user does, in what state, and what goes wrong. Delete any finding you cannot state that way.+2. **Read the actual code.** Every finding must cite \`path/to/file.js:LINE\` and describe a concrete, reproducible impact: a reachable runtime/data failure, a CI or release failure, or recurring manual churn demonstrated by repository history. Delete subjective style preferences and any finding whose consequence you cannot prove.3. **De-duplicate before filing.** Follow the Inventory step under "Where to record findings" above. If it is already filed, skip it; comment on the existing item only when you have genuinely new evidence.4. **File each surviving finding as its own item.** One problem per item — never a bundle. Cap yourself at 5. Bodies must be decision-complete:- **Problem** — what is wrong, with file:line references.- - **Impact** — the user-visible consequence, not the code smell.+ - **Impact** — the observable consequence (runtime, data, CI/release, or recurring maintenance), not a code-smell label.- **Fix** — the approach you have DECIDED on, with the files it touches. If the only obstacle was a design choice, make the call and state it. Do not file a question.- **Acceptance criteria** — checkboxes another agent can verify cold.5. **Redact before you publish.** An issue is world-readable the moment it is filed. Never paste a secret, credential, token, hostname, IP address, absolute path containing a username, or any personal record into a title or body.@@ -55,7 +55,7 @@ This banner OVERRIDES any later instruction to file issues, leave source unchang1. **Pick a bounded slice** and say so first.2. **Read the actual code** and the project's \`AGENTS.md\` / conventions. Honor documented non-issues.-3. **Implement the fix** — the smallest change that actually solves the user-visible problem. If the only obstacle was a design choice, make the call and state it.+3. **Implement the fix** — the smallest change that actually solves the concrete problem. If the only obstacle was a design choice, make the call and state it.4. **Verify** with the project's tests (or a focused new test when the path is untested and a silent break would cost data, money, or quota).5. **Commit** following the repo's conventions. Do not bundle unrelated cleanup.diff --git a/server/lib/auditCatalog.test.js b/server/lib/auditCatalog.test.jsindex 4f6386bf75..58c496da6b 100644--- a/server/lib/auditCatalog.test.js+++ b/server/lib/auditCatalog.test.js@@ -67,6 +67,8 @@ describe('mode contracts + wrapper', () => {expect(FILE_ISSUES_MODE_CONTRACT).toContain('{trackerInstructions}');expect(FILE_ISSUES_MODE_CONTRACT).toContain('OVERRIDES');expect(FILE_ISSUES_MODE_CONTRACT).toContain('same `git status`');+ expect(FILE_ISSUES_MODE_CONTRACT).toContain('CI or release failure');+ expect(FILE_ISSUES_MODE_CONTRACT).toContain('recurring manual churn');expect(modeContractFor(true)).toBe(FILE_ISSUES_MODE_CONTRACT);});diff --git a/server/lib/index.js b/server/lib/index.jsindex d7ada2901d..7ffcc1accc 100644--- a/server/lib/index.js+++ b/server/lib/index.js@@ -48,6 +48,7 @@ export * as privacyValidation from './privacyValidation.js';export * as roundsValidation from './roundsValidation.js';export * as socketValidation from './socketValidation.js';export * from './socketEventContracts.js';+export * from './socketEventInventory.js';export * as spriteValidation from './spriteValidation.js';export * as storyBuilderValidation from './storyBuilderValidation.js';export * as telegramValidation from './telegramValidation.js';diff --git a/server/lib/openapiDowngrade.test.js b/server/lib/openapiDowngrade.test.jsindex e8fde497c1..4ad5a28dc9 100644--- a/server/lib/openapiDowngrade.test.js+++ b/server/lib/openapiDowngrade.test.js@@ -179,7 +179,7 @@ describe('the published documents are actually 3.0.3', () => {// `exclusiveMinimum` a downgrade would introduce reads as a type error// there, widening `lines > 0` into `lines >= 0`.const { buildAsyncApiSpec } = await import('./asyncApiSpec.js');- const serialized = JSON.stringify(buildAsyncApiSpec({ version: '1.0.0' }));+ const serialized = JSON.stringify(await buildAsyncApiSpec({ version: '1.0.0' }));expect(serialized).not.toContain('"exclusiveMinimum":true');expect(serialized).not.toContain('"nullable"');});diff --git a/server/lib/socketEventCatalog.generated.json b/server/lib/socketEventCatalog.generated.jsondeleted file mode 100644index c818e1fe05..0000000000--- a/server/lib/socketEventCatalog.generated.json+++ /dev/null@@ -1,5491 +0,0 @@-{- "schemaVersion": 1,- "generatedFrom": [- "server/**/*.js",- "!server/cos-runner/**",- "client/src/**/*.{js,jsx}"- ],- "events": [- {- "event": "agent:btw",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 159- }- ]- },- {- "event": "agent:completed",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 157- }- ]- },- {- "event": "agent:error",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 158- }- ]- },- {- "event": "agent:output",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 156- }- ]- },- {- "event": "agents:account:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 436- }- ]- },- {- "event": "agents:activity",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 443- }- ]- },- {- "event": "agents:activity:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 444- }- ]- },- {- "event": "agents:orphaned",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 164- }- ]- },- {- "event": "agents:personality:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 433- }- ]- },- {- "event": "agents:schedule:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 439- }- ]- },- {- "event": "agents:schedule:execute",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 440- }- ]- },- {- "event": "agents:subscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 45- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 125- }- ]- },- {- "event": "agents:subscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 125- }- ]- },- {- "event": "agents:unsubscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 125- }- ]- },- {- "event": "agents:unsubscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 125- }- ]- },- {- "event": "ai:status",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAIStatusNotifications.js",- "line": 196- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useFableLoomAiRun.js",- "line": 17- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 320- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 306- }- ]- },- {- "event": "app:deploy",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useAppDeploy.js",- "line": 61- },- {- "direction": "client-to-server",- "source": "server/sockets/apps.js",- "line": 242- }- ]- },- {- "event": "app:deploy:{type}",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 248- }- ]- },- {- "event": "app:deploy:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppDeploy.js",- "line": 60- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 256- }- ]- },- {- "event": "app:deploy:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppDeploy.js",- "line": 59- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 253- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 260- }- ]- },- {- "event": "app:deploy:output",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppDeploy.js",- "line": 57- }- ]- },- {- "event": "app:deploy:status",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppDeploy.js",- "line": 58- }- ]- },- {- "event": "app:operations:active",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 134- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 33- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 39- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 238- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 240- }- ]- },- {- "event": "app:operations:list",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useAppOperation.js",- "line": 106- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useAppOperation.js",- "line": 132- },- {- "direction": "client-to-server",- "source": "server/sockets/apps.js",- "line": 237- }- ]- },- {- "event": "app:standardize",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/apps.js",- "line": 141- }- ]- },- {- "event": "app:standardize:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 140- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 216- }- ]- },- {- "event": "app:standardize:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 139- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 149- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 155- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 161- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 184- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 203- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 230- }- ]- },- {- "event": "app:standardize:step",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 138- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 175- }- ]- },- {- "event": "app:update",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/apps.js",- "line": 91- }- ]- },- {- "event": "app:update:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 137- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 128- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 135- }- ]- },- {- "event": "app:update:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 136- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 99- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 105- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 123- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 134- }- ]- },- {- "event": "app:update:step",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 135- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 119- }- ]- },- {- "event": "apps:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/AppDetailView.jsx",- "line": 101- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 203- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useSidebarApps.js",- "line": 26- },- {- "direction": "server-to-client",- "source": "client/src/pages/Apps.jsx",- "line": 65- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 440- },- {- "direction": "server-to-client",- "source": "client/src/pages/Dashboard.jsx",- "line": 128- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 410- }- ]- },- {- "event": "audio-gen:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 598- }- ]- },- {- "event": "audio-gen:failed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 601- }- ]- },- {- "event": "audio-gen:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 595- }- ]- },- {- "event": "audio-gen:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 592- }- ]- },- {- "event": "backup:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 255- },- {- "direction": "server-to-client",- "source": "server/services/backup.js",- "line": 332- }- ]- },- {- "event": "backup:failed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/backup.js",- "line": 293- }- ]- },- {- "event": "backup:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 254- },- {- "direction": "server-to-client",- "source": "server/services/backup.js",- "line": 299- }- ]- },- {- "event": "brain:classified",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/brain/tabs/InboxTab.jsx",- "line": 105- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 451- }- ]- },- {- "event": "build:id",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/services/socket.js",- "line": 62- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 109- }- ]- },- {- "event": "calendar:google:autoconfig",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/googleOAuthAutoConfig.js",- "line": 113- },- {- "direction": "server-to-client",- "source": "server/services/googleOAuthAutoConfig.js",- "line": 120- },- {- "direction": "server-to-client",- "source": "server/services/googleOAuthAutoConfig.js",- "line": 136- },- {- "direction": "server-to-client",- "source": "server/services/googleOAuthAutoConfig.js",- "line": 540- },- {- "direction": "server-to-client",- "source": "server/services/googleOAuthAutoConfig.js",- "line": 579- }- ]- },- {- "event": "calendar:sync:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/calendar/AgendaTab.jsx",- "line": 69- },- {- "direction": "server-to-client",- "source": "client/src/components/calendar/DayView.jsx",- "line": 123- },- {- "direction": "server-to-client",- "source": "client/src/components/calendar/MonthView.jsx",- "line": 61- },- {- "direction": "server-to-client",- "source": "client/src/components/calendar/SyncTab.jsx",- "line": 42- },- {- "direction": "server-to-client",- "source": "client/src/components/calendar/WeekView.jsx",- "line": 138- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleApiSync.js",- "line": 70- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleSync.js",- "line": 155- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleSync.js",- "line": 243- },- {- "direction": "server-to-client",- "source": "server/services/calendarSync.js",- "line": 231- }- ]- },- {- "event": "calendar:sync:event",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/calendarApiSync.js",- "line": 81- },- {- "direction": "server-to-client",- "source": "server/services/calendarApiSync.js",- "line": 149- }- ]- },- {- "event": "calendar:sync:failed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/calendar/SyncTab.jsx",- "line": 43- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleSync.js",- "line": 270- },- {- "direction": "server-to-client",- "source": "server/services/calendarSync.js",- "line": 240- }- ]- },- {- "event": "calendar:sync:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/calendar/SyncTab.jsx",- "line": 44- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleApiSync.js",- "line": 30- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleSync.js",- "line": 298- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleSync.js",- "line": 371- }- ]- },- {- "event": "calendar:sync:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/calendar/SyncTab.jsx",- "line": 41- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleApiSync.js",- "line": 18- },- {- "direction": "server-to-client",- "source": "server/services/calendarGoogleSync.js",- "line": 182- },- {- "direction": "server-to-client",- "source": "server/services/calendarSync.js",- "line": 160- }- ]- },- {- "event": "catalog:extract:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/CatalogIngest.jsx",- "line": 146- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 268- }- ]- },- {- "event": "command:{commandId}:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/RunnerPage.jsx",- "line": 131- },- {- "direction": "server-to-client",- "source": "server/routes/commands.js",- "line": 58- }- ]- },- {- "event": "command:{commandId}:data",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/RunnerPage.jsx",- "line": 130- },- {- "direction": "server-to-client",- "source": "server/routes/commands.js",- "line": 55- }- ]- },- {- "event": "connect",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/IssuesTab.jsx",- "line": 202- },- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/PullRequestsTab.jsx",- "line": 116- },- {- "direction": "server-to-client",- "source": "client/src/components/cos/tabs/MindTab.jsx",- "line": 334- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useAppOperation.js",- "line": 141- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImporterProgress.js",- "line": 69- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 47- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 200- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 849- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useSocket.js",- "line": 15- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 312- },- {- "direction": "server-to-client",- "source": "client/src/services/socket.js",- "line": 18- },- {- "direction": "server-to-client",- "source": "client/src/services/socket.js",- "line": 63- },- {- "direction": "server-to-client",- "source": "client/src/services/voiceClient.js",- "line": 556- },- {- "direction": "client-to-server",- "source": "server/lib/connectivity.js",- "line": 47- },- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 133- },- {- "direction": "client-to-server",- "source": "server/services/peerSocketRelay.js",- "line": 46- },- {- "direction": "client-to-server",- "source": "server/services/remoteDesktop.js",- "line": 47- }- ]- },- {- "event": "connect_error",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/services/socket.js",- "line": 26- },- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 149- }- ]- },- {- "event": "cos:agent:btw",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 351- }- ]- },- {- "event": "cos:agent:completed",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/IssuesTab.jsx",- "line": 262- },- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/PullRequestsTab.jsx",- "line": 156- },- {- "direction": "server-to-client",- "source": "client/src/components/WhileAwayWidget.jsx",- "line": 88- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useAgentFeedbackToast.jsx",- "line": 205- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 219- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 403- },- {- "direction": "client-to-server",- "source": "server/services/peerSocketRelay.js",- "line": 89- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 349- }- ]- },- {- "event": "cos:agent:output",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/feature-agents/OutputTab.jsx",- "line": 44- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 384- },- {- "direction": "client-to-server",- "source": "server/services/peerSocketRelay.js",- "line": 84- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 350- }- ]- },- {- "event": "cos:agent:spawned",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/IssuesTab.jsx",- "line": 261- },- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/PullRequestsTab.jsx",- "line": 155- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 209- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 365- },- {- "direction": "client-to-server",- "source": "server/services/peerSocketRelay.js",- "line": 61- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 347- }- ]- },- {- "event": "cos:agent:updated",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 214- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 373- },- {- "direction": "client-to-server",- "source": "server/services/peerSocketRelay.js",- "line": 72- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 348- }- ]- },- {- "event": "cos:evaluation",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 366- }- ]- },- {- "event": "cos:feature-agent:output",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/feature-agents/OutputTab.jsx",- "line": 45- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 371- }- ]- },- {- "event": "cos:feature-agent:run-complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/FeatureAgentDetail.jsx",- "line": 57- },- {- "direction": "server-to-client",- "source": "client/src/pages/FeatureAgents.jsx",- "line": 26- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 372- }- ]- },- {- "event": "cos:feature-agent:status",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/FeatureAgentDetail.jsx",- "line": 56- },- {- "direction": "server-to-client",- "source": "client/src/pages/FeatureAgents.jsx",- "line": 25- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 370- }- ]- },- {- "event": "cos:health:check",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 417- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 362- }- ]- },- {- "event": "cos:health:critical",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 363- }- ]- },- {- "event": "cos:log",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 228- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 434- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 334- }- ]- },- {- "event": "cos:memory:approval-needed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 359- }- ]- },- {- "event": "cos:memory:created",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 355- }- ]- },- {- "event": "cos:memory:deleted",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 357- }- ]- },- {- "event": "cos:memory:extracted",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 358- }- ]- },- {- "event": "cos:memory:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 356- }- ]- },- {- "event": "cos:mind:event",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/cos/tabs/MindTab.jsx",- "line": 335- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 218- }- ]- },- {- "event": "cos:mind:status",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/cos/tabs/MindTab.jsx",- "line": 336- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 352- }- ]- },- {- "event": "cos:schedule:on-demand-empty",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOnDemandTaskToast.js",- "line": 112- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 381- }- ]- },- {- "event": "cos:status",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 233- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 322- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 331- }- ]- },- {- "event": "cos:subscribe",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/components/apps/tabs/IssuesTab.jsx",- "line": 200- },- {- "direction": "client-to-server",- "source": "client/src/components/apps/tabs/PullRequestsTab.jsx",- "line": 114- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useAgentFeedbackToast.jsx",- "line": 156- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useOnDemandTaskToast.js",- "line": 36- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 196- },- {- "direction": "client-to-server",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 303- },- {- "direction": "server-to-client",- "source": "server/services/peerSocketRelay.js",- "line": 48- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 122- }- ]- },- {- "event": "cos:subscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 122- }- ]- },- {- "event": "cos:task:ready",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 367- }- ]- },- {- "event": "cos:tasks:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/IssuesTab.jsx",- "line": 258- },- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/PullRequestsTab.jsx",- "line": 152- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 347- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 340- }- ]- },- {- "event": "cos:tasks:cos:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 261- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 336- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 344- }- ]- },- {- "event": "cos:tasks:user:added",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 342- }- ]- },- {- "event": "cos:tasks:user:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/IssuesTab.jsx",- "line": 259- },- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/PullRequestsTab.jsx",- "line": 153- },- {- "direction": "server-to-client",- "source": "client/src/pages/ChiefOfStaff.jsx",- "line": 327- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 341- }- ]- },- {- "event": "cos:tasks:user:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/IssuesTab.jsx",- "line": 260- },- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/PullRequestsTab.jsx",- "line": 154- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 343- }- ]- },- {- "event": "cos:unsubscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 122- }- ]- },- {- "event": "cos:unsubscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 122- }- ]- },- {- "event": "cos:watcher:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 375- }- ]- },- {- "event": "cos:watcher:stopped",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 376- }- ]- },- {- "event": "database:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/settings/DatabaseTab.jsx",- "line": 212- },- {- "direction": "server-to-client",- "source": "server/services/dbAdmin.js",- "line": 48- },- {- "direction": "server-to-client",- "source": "server/services/dbAdmin.js",- "line": 215- },- {- "direction": "server-to-client",- "source": "server/services/dbAdmin.js",- "line": 429- }- ]- },- {- "event": "detect:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/streamingDetect.js",- "line": 1188- },- {- "direction": "server-to-client",- "source": "server/services/streamingDetect.js",- "line": 1195- },- {- "direction": "server-to-client",- "source": "server/services/streamingDetect.js",- "line": 1503- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 61- }- ]- },- {- "event": "detect:start",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/apps.js",- "line": 51- }- ]- },- {- "event": "detect:step",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/streamingDetect.js",- "line": 1163- }- ]- },- {- "event": "digital-twin:test-progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/routes/digital-twin/tests.js",- "line": 66- }- ]- },- {- "event": "disconnect",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/UpdateTab.jsx",- "line": 166- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 850- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useSocket.js",- "line": 16- },- {- "direction": "server-to-client",- "source": "client/src/services/socket.js",- "line": 22- },- {- "direction": "server-to-client",- "source": "client/src/services/voiceClient.js",- "line": 445- },- {- "direction": "client-to-server",- "source": "server/routes/scaffoldPortOS.js",- "line": 315- },- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 144- },- {- "direction": "client-to-server",- "source": "server/services/peerSocketRelay.js",- "line": 54- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 154- },- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 198- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 638- }- ]- },- {- "event": "error",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/lib/connectivity.js",- "line": 49- },- {- "direction": "client-to-server",- "source": "server/services/remoteDesktop.js",- "line": 49- }- ]- },- {- "event": "error:notified",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useErrorNotifications.js",- "line": 85- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 395- }- ]- },- {- "event": "error:occurred",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/lib/errorHandler.js",- "line": 325- }- ]- },- {- "event": "error:recover",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useErrorNotifications.js",- "line": 15- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 131- }- ]- },- {- "event": "error:recover:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 148- }- ]- },- {- "event": "error:recover:requested",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useErrorNotifications.js",- "line": 87- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 139- }- ]- },- {- "event": "error:server",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 60- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 86- }- ]- },- {- "event": "errors:subscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useErrorNotifications.js",- "line": 24- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 123- }- ]- },- {- "event": "errors:subscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 123- }- ]- },- {- "event": "errors:unsubscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useErrorNotifications.js",- "line": 90- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 123- }- ]- },- {- "event": "errors:unsubscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 123- }- ]- },- {- "event": "genome:clinvar-progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/routes/genome.js",- "line": 105- }- ]- },- {- "event": "health:xml:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/meatspace/tabs/SettingsTab.jsx",- "line": 31- },- {- "direction": "server-to-client",- "source": "server/services/appleHealthXml.js",- "line": 321- }- ]- },- {- "event": "health:xml:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/meatspace/tabs/SettingsTab.jsx",- "line": 30- },- {- "direction": "server-to-client",- "source": "server/services/appleHealthXml.js",- "line": 285- }- ]- },- {- "event": "hosted:audio:target",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 127- }- ]- },- {- "event": "hosted:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/fableLoomHosted.js",- "line": 123- },- {- "direction": "server-to-client",- "source": "server/sockets/fableLoomHosted.js",- "line": 133- },- {- "direction": "server-to-client",- "source": "server/sockets/fableLoomHosted.js",- "line": 148- },- {- "direction": "server-to-client",- "source": "server/sockets/fableLoomHosted.js",- "line": 172- },- {- "direction": "server-to-client",- "source": "server/sockets/fableLoomHosted.js",- "line": 181- }- ]- },- {- "event": "hosted:mic:frame",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 152- }- ]- },- {- "event": "hosted:mic:start",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/FableLoomHostedJoin.jsx",- "line": 155- },- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 143- }- ]- },- {- "event": "hosted:mic:stop",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/FableLoomHostedJoin.jsx",- "line": 145- },- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 159- }- ]- },- {- "event": "hosted:peer:status",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/fableloom/LoomPlayPanel.jsx",- "line": 125- }- ]- },- {- "event": "hosted:playback:update",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 109- }- ]- },- {- "event": "hosted:session:end",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 137- }- ]- },- {- "event": "hosted:session:ended",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/fableloom/LoomPlayPanel.jsx",- "line": 156- }- ]- },- {- "event": "hosted:session:sync",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/fableLoomHosted.js",- "line": 96- }- ]- },- {- "event": "hosted:speech:done",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 185- }- ]- },- {- "event": "hosted:story:transition",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/fableloom/LoomPlayPanel.jsx",- "line": 148- }- ]- },- {- "event": "hosted:turn:abort",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 193- }- ]- },- {- "event": "hosted:turn:phase",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/fableloom/LoomPlayPanel.jsx",- "line": 129- }- ]- },- {- "event": "hosted:turn:text",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/FableLoomHostedJoin.jsx",- "line": 172- },- {- "direction": "client-to-server",- "source": "server/sockets/fableLoomHosted.js",- "line": 176- }- ]- },- {- "event": "hosted:turn:transcript",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/fableloom/LoomPlayPanel.jsx",- "line": 133- }- ]- },- {- "event": "hosted:turn:tts",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/fableloom/LoomPlayPanel.jsx",- "line": 137- }- ]- },- {- "event": "image-gen:canceled",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/LiveRenderPanel.jsx",- "line": 143- },- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/SceneCard.jsx",- "line": 159- }- ]- },- {- "event": "image-gen:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/LiveRenderPanel.jsx",- "line": 137- },- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/SceneCard.jsx",- "line": 157- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenProgress.js",- "line": 53- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenQueue.js",- "line": 180- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useMediaCompletionRefresh.js",- "line": 25- },- {- "direction": "server-to-client",- "source": "client/src/pages/CharacterSheet.jsx",- "line": 228- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 567- }- ]- },- {- "event": "image-gen:failed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/LiveRenderPanel.jsx",- "line": 138- },- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/SceneCard.jsx",- "line": 158- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenProgress.js",- "line": 54- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenQueue.js",- "line": 181- },- {- "direction": "server-to-client",- "source": "client/src/pages/CharacterSheet.jsx",- "line": 229- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 570- }- ]- },- {- "event": "image-gen:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/SceneCard.jsx",- "line": 156- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenProgress.js",- "line": 52- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenQueue.js",- "line": 179- },- {- "direction": "server-to-client",- "source": "client/src/pages/CharacterSheet.jsx",- "line": 227- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 564- }- ]- },- {- "event": "image-gen:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/SceneCard.jsx",- "line": 155- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenProgress.js",- "line": 51- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useImageGenQueue.js",- "line": 178- },- {- "direction": "server-to-client",- "source": "client/src/pages/CharacterSheet.jsx",- "line": 226- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 561- }- ]- },- {- "event": "importer:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useImporterProgress.js",- "line": 58- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 116- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 259- }- ]- },- {- "event": "importer:progress:replay",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useImporterProgress.js",- "line": 67- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 114- }- ]- },- {- "event": "instances:peer:agent:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/instances/PeerAgentsSection.jsx",- "line": 63- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 499- }- ]- },- {- "event": "instances:peer:agent:output",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/instances/PeerAgentsSection.jsx",- "line": 62- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 498- }- ]- },- {- "event": "instances:peer:agent:spawned",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/instances/PeerAgentsSection.jsx",- "line": 60- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 496- }- ]- },- {- "event": "instances:peer:agent:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/instances/PeerAgentsSection.jsx",- "line": 61- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 497- }- ]- },- {- "event": "instances:peer:agents:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/instances/PeerAgentsSection.jsx",- "line": 59- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 495- }- ]- },- {- "event": "instances:peers:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/DataManager.jsx",- "line": 55- },- {- "direction": "server-to-client",- "source": "client/src/pages/Instances.jsx",- "line": 1423- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 484- }- ]- },- {- "event": "instances:subscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/Instances.jsx",- "line": 1419- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 126- }- ]- },- {- "event": "instances:subscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 126- }- ]- },- {- "event": "instances:unsubscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/Instances.jsx",- "line": 1431- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 126- }- ]- },- {- "event": "instances:unsubscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 126- }- ]- },- {- "event": "legacy-export:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/digital-twin/tabs/LegacyExportTab.jsx",- "line": 53- }- ]- },- {- "event": "legacy-export:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/digital-twin/tabs/LegacyExportTab.jsx",- "line": 52- }- ]- },- {- "event": "literal",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 203- }- ]- },- {- "event": "llamaServer:download",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/settings/LocalLlmTab.jsx",- "line": 354- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 671- }- ]- },- {- "event": "localLlm:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/settings/AssessmentSweepPanel.jsx",- "line": 392- },- {- "direction": "server-to-client",- "source": "client/src/components/settings/LocalLlmTab.jsx",- "line": 423- },- {- "direction": "server-to-client",- "source": "client/src/components/settings/LocalModelAssessments.jsx",- "line": 840- },- {- "direction": "server-to-client",- "source": "client/src/components/settings/ModelCapabilityTests.jsx",- "line": 718- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 95- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 516- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 549- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 610- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 708- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 719- }- ]- },- {- "event": "logs:close",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/logs.js",- "line": 148- }- ]- },- {- "event": "logs:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useProcessLogs.js",- "line": 77- },- {- "direction": "server-to-client",- "source": "server/sockets/logs.js",- "line": 140- },- {- "direction": "server-to-client",- "source": "server/sockets/logs.js",- "line": 157- }- ]- },- {- "event": "logs:line",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useProcessLogs.js",- "line": 75- },- {- "direction": "server-to-client",- "source": "server/sockets/logs.js",- "line": 113- },- {- "direction": "server-to-client",- "source": "server/sockets/logs.js",- "line": 129- }- ]- },- {- "event": "logs:subscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useProcessLogs.js",- "line": 59- },- {- "direction": "client-to-server",- "source": "server/sockets/logs.js",- "line": 54- }- ]- },- {- "event": "logs:subscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useProcessLogs.js",- "line": 76- },- {- "direction": "server-to-client",- "source": "server/sockets/logs.js",- "line": 153- }- ]- },- {- "event": "logs:unsubscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useProcessLogs.js",- "line": 80- },- {- "direction": "client-to-server",- "source": "server/sockets/logs.js",- "line": 161- }- ]- },- {- "event": "logs:unsubscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/logs.js",- "line": 166- }- ]- },- {- "event": "loop:created",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 543- }- ]- },- {- "event": "loop:deleted",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 546- }- ]- },- {- "event": "loop:iteration:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Loops.jsx",- "line": 214- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 549- }- ]- },- {- "event": "loop:iteration:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Loops.jsx",- "line": 216- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 550- }- ]- },- {- "event": "loop:iteration:start",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Loops.jsx",- "line": 215- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 548- }- ]- },- {- "event": "loop:output",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Loops.jsx",- "line": 213- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 551- }- ]- },- {- "event": "loop:resumed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 545- }- ]- },- {- "event": "loop:stopped",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 544- }- ]- },- {- "event": "loop:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 547- }- ]- },- {- "event": "loops:subscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/Loops.jsx",- "line": 364- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 127- }- ]- },- {- "event": "loops:subscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 127- }- ]- },- {- "event": "loops:unsubscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/Loops.jsx",- "line": 370- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 127- }- ]- },- {- "event": "loops:unsubscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 127- }- ]- },- {- "event": "media:annotation:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMediaAnnotations.js",- "line": 76- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 140- }- ]- },- {- "event": "media:sketch:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/pipeline/stages/StoryboardsStage.jsx",- "line": 62- }- ]- },- {- "event": "messages:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/messageSender.js",- "line": 43- },- {- "direction": "server-to-client",- "source": "server/services/messageSync.js",- "line": 323- }- ]- },- {- "event": "messages:draft:sent",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/messageSender.js",- "line": 42- }- ]- },- {- "event": "messages:sync:auth-required",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/messages/SyncTab.jsx",- "line": 58- },- {- "direction": "server-to-client",- "source": "server/services/messagePlaywrightSync.js",- "line": 76- }- ]- },- {- "event": "messages:sync:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/messages/SyncTab.jsx",- "line": 57- },- {- "direction": "server-to-client",- "source": "server/services/messageSync.js",- "line": 321- }- ]- },- {- "event": "messages:sync:failed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/messages/SyncTab.jsx",- "line": 59- },- {- "direction": "server-to-client",- "source": "server/services/messageSync.js",- "line": 337- }- ]- },- {- "event": "messages:sync:message",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/messages/InboxTab.jsx",- "line": 295- },- {- "direction": "server-to-client",- "source": "server/services/messageApiSync.js",- "line": 128- },- {- "direction": "server-to-client",- "source": "server/services/messageGmailSync.js",- "line": 346- },- {- "direction": "server-to-client",- "source": "server/services/messagePlaywrightSync.js",- "line": 128- }- ]- },- {- "event": "messages:sync:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/messageApiSync.js",- "line": 58- },- {- "direction": "server-to-client",- "source": "server/services/messageGmailSync.js",- "line": 264- },- {- "direction": "server-to-client",- "source": "server/services/messageGmailSync.js",- "line": 283- },- {- "direction": "server-to-client",- "source": "server/services/messagePlaywrightSync.js",- "line": 68- },- {- "direction": "server-to-client",- "source": "server/services/messagePlaywrightSync.js",- "line": 91- },- {- "direction": "server-to-client",- "source": "server/services/messagePlaywrightSync.js",- "line": 134- }- ]- },- {- "event": "messages:sync:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/messages/SyncTab.jsx",- "line": 56- },- {- "direction": "server-to-client",- "source": "server/services/messageSync.js",- "line": 163- }- ]- },- {- "event": "moltworld:action",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 85- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 462- }- ]- },- {- "event": "moltworld:event",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 82- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 459- }- ]- },- {- "event": "moltworld:interaction",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 86- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 463- }- ]- },- {- "event": "moltworld:nearby",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 87- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 464- }- ]- },- {- "event": "moltworld:presence",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 83- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 460- }- ]- },- {- "event": "moltworld:queue:added",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/agents/tabs/WorldTab.jsx",- "line": 219- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 469- }- ]- },- {- "event": "moltworld:queue:removed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/agents/tabs/WorldTab.jsx",- "line": 221- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 471- }- ]- },- {- "event": "moltworld:queue:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/agents/tabs/WorldTab.jsx",- "line": 220- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 470- }- ]- },- {- "event": "moltworld:status",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 81- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 458- }- ]- },- {- "event": "moltworld:thinking",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMoltworldWs.js",- "line": 84- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 461- }- ]- },- {- "event": "mtplx:download",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/settings/LocalLlmTab.jsx",- "line": 379- },- {- "direction": "server-to-client",- "source": "server/routes/localLlm.js",- "line": 800- }- ]- },- {- "event": "music-video:scene-image",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 291- }- ]- },- {- "event": "music-video:scene-video",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 297- }- ]- },- {- "event": "notifications:added",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useNotifications.js",- "line": 66- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 420- }- ]- },- {- "event": "notifications:cleared",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useNotifications.js",- "line": 70- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 243- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 424- }- ]- },- {- "event": "notifications:count",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useNotifications.js",- "line": 69- },- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 242- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 423- }- ]- },- {- "event": "notifications:removed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useNotifications.js",- "line": 67- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 421- }- ]- },- {- "event": "notifications:subscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useNotifications.js",- "line": 40- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 197- },- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 124- }- ]- },- {- "event": "notifications:subscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 124- }- ]- },- {- "event": "notifications:unsubscribe",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/socket.js",- "line": 124- }- ]- },- {- "event": "notifications:unsubscribed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 124- }- ]- },- {- "event": "notifications:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useNotifications.js",- "line": 68- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 422- }- ]- },- {- "event": "peerSync:asset-arrived",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/MediaImage.jsx",- "line": 78- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 146- }- ]- },- {- "event": "peerSync:subscription-blocked",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Instances.jsx",- "line": 1184- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 122- }- ]- },- {- "event": "peerSync:subscription-unblocked",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Instances.jsx",- "line": 1185- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 125- }- ]- },- {- "event": "peerSync:subscription:created",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Instances.jsx",- "line": 1192- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 131- }- ]- },- {- "event": "portos:update:available",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useUpdateChecker.jsx",- "line": 60- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 525- }- ]- },- {- "event": "portos:update:checked",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 530- }- ]- },- {- "event": "portos:update:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/UpdateTab.jsx",- "line": 164- },- {- "direction": "server-to-client",- "source": "server/routes/update.js",- "line": 309- }- ]- },- {- "event": "portos:update:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/UpdateTab.jsx",- "line": 165- },- {- "direction": "server-to-client",- "source": "server/routes/update.js",- "line": 311- },- {- "direction": "server-to-client",- "source": "server/routes/update.js",- "line": 316- }- ]- },- {- "event": "portos:update:step",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/apps/tabs/UpdateTab.jsx",- "line": 163- },- {- "direction": "server-to-client",- "source": "server/routes/update.js",- "line": 284- }- ]- },- {- "event": "provider:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/index.js",- "line": 96- }- ]- },- {- "event": "provider:status:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/cos/tabs/ProviderStatusCard.jsx",- "line": 36- },- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/index.js",- "line": 78- }- ]- },- {- "event": "review:item:created",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/ReviewHubCard.jsx",- "line": 14- },- {- "direction": "server-to-client",- "source": "client/src/pages/Review.jsx",- "line": 146- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 508- }- ]- },- {- "event": "review:item:deleted",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/ReviewHubCard.jsx",- "line": 16- },- {- "direction": "server-to-client",- "source": "client/src/pages/Review.jsx",- "line": 148- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 514- }- ]- },- {- "event": "review:item:updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/ReviewHubCard.jsx",- "line": 15- },- {- "direction": "server-to-client",- "source": "client/src/pages/Review.jsx",- "line": 147- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 511- }- ]- },- {- "event": "run:{activeRun}:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/AIProviders.jsx",- "line": 180- }- ]- },- {- "event": "run:{activeRun}:data",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/AIProviders.jsx",- "line": 179- }- ]- },- {- "event": "run:{runId}:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/RunnerPage.jsx",- "line": 105- },- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/routes/runs.js",- "line": 111- },- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/routes/runs.js",- "line": 127- },- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/routes/runs.js",- "line": 151- }- ]- },- {- "event": "run:{runId}:data",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/RunnerPage.jsx",- "line": 104- },- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/routes/runs.js",- "line": 107- },- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/routes/runs.js",- "line": 124- },- {- "direction": "server-to-client",- "source": "server/lib/aiToolkit/routes/runs.js",- "line": 147- }- ]- },- {- "event": "sharing:inbox-updated",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Sharing.jsx",- "line": 176- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 95- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 99- }- ]- },- {- "event": "sharing:incompatible-manifest",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useSharingNotifications.js",- "line": 41- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 108- }- ]- },- {- "event": "sharing:manifest-processed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useSharingNotifications.js",- "line": 40- },- {- "direction": "server-to-client",- "source": "client/src/pages/Sharing.jsx",- "line": 177- },- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 93- }- ]- },- {- "event": "sharing:portos-schema-ahead",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 116- }- ]- },- {- "event": "sharing:unshared",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 134- }- ]- },- {- "event": "sharing:watcher-attached",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 102- }- ]- },- {- "event": "sharing:watcher-detached",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/sharing/index.js",- "line": 105- }- ]- },- {- "event": "shell:attach",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 489- },- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 51- }- ]- },- {- "event": "shell:attached",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 853- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 58- }- ]- },- {- "event": "shell:cd",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 79- }- ]- },- {- "event": "shell:detached",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 856- }- ]- },- {- "event": "shell:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 857- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 29- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 42- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 47- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 56- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 60- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 73- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 84- }- ]- },- {- "event": "shell:exit",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 855- },- {- "direction": "server-to-client",- "source": "server/services/shell.js",- "line": 229- },- {- "direction": "server-to-client",- "source": "server/services/shell.js",- "line": 442- }- ]- },- {- "event": "shell:input",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 69- }- ]- },- {- "event": "shell:list",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 606- },- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 64- }- ]- },- {- "event": "shell:output",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 854- },- {- "direction": "server-to-client",- "source": "server/services/shell.js",- "line": 212- },- {- "direction": "server-to-client",- "source": "server/services/shell.js",- "line": 425- }- ]- },- {- "event": "shell:release-views",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 878- },- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 103- }- ]- },- {- "event": "shell:resize",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 320- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 690- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 718- },- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 91- }- ]- },- {- "event": "shell:sessions",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 851- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 66- }- ]- },- {- "event": "shell:start",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 470- },- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 19- }- ]- },- {- "event": "shell:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useShellSession.js",- "line": 852- },- {- "direction": "server-to-client",- "source": "server/sockets/shell.js",- "line": 37- }- ]- },- {- "event": "shell:stop",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 529- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 535- },- {- "direction": "client-to-server",- "source": "client/src/hooks/useShellSession.js",- "line": 551- },- {- "direction": "client-to-server",- "source": "server/sockets/shell.js",- "line": 97- }- ]- },- {- "event": "standardize:analyzed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 79- }- ]- },- {- "event": "standardize:complete",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 82- },- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 87- }- ]- },- {- "event": "standardize:start",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/sockets/apps.js",- "line": 67- }- ]- },- {- "event": "standardize:step",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/sockets/apps.js",- "line": 77- }- ]- },- {- "event": "sync:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Instances.jsx",- "line": 1145- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 489- }- ]- },- {- "event": "system:critical-error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useErrorNotifications.js",- "line": 86- },- {- "direction": "server-to-client",- "source": "server/lib/errorHandler.js",- "line": 337- }- ]- },- {- "event": "timeout",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/lib/connectivity.js",- "line": 48- },- {- "direction": "client-to-server",- "source": "server/services/remoteDesktop.js",- "line": 48- }- ]- },- {- "event": "tribe:changed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/Tribe.jsx",- "line": 988- }- ]- },- {- "event": "tui:exit",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 161- }- ]- },- {- "event": "tui:output",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "server/services/cosRunnerClient.js",- "line": 160- }- ]- },- {- "event": "video-gen:completed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useMediaCompletionRefresh.js",- "line": 26- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 580- }- ]- },- {- "event": "video-gen:failed",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 583- }- ]- },- {- "event": "video-gen:progress",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 577- }- ]- },- {- "event": "video-gen:started",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 574- }- ]- },- {- "event": "voice:call:attach",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 204- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 476- }- ]- },- {- "event": "voice:call:audio",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 194- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 503- }- ]- },- {- "event": "voice:call:detach",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 210- },- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 255- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 542- }- ]- },- {- "event": "voice:call:hangup",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/components/cos/tabs/MindTab.jsx",- "line": 354- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 552- }- ]- },- {- "event": "voice:call:state",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/cos/tabs/MindTab.jsx",- "line": 346- },- {- "direction": "server-to-client",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 248- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 231- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 425- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 484- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 491- }- ]- },- {- "event": "voice:call:tts",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 250- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 416- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 457- }- ]- },- {- "event": "voice:capture:start",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 205- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 593- }- ]- },- {- "event": "voice:capture:state",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 249- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 569- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 597- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 602- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 607- }- ]- },- {- "event": "voice:capture:stop",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 211- },- {- "direction": "client-to-server",- "source": "client/src/pages/VoiceCallHost.jsx",- "line": 256- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 620- }- ]- },- {- "event": "voice:dictation",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 278- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 262- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 286- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 291- }- ]- },- {- "event": "voice:dictation:set",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 549- },- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 558- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 279- }- ]- },- {- "event": "voice:error",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 279- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 170- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 183- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 192- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 197- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 201- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 217- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 226- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 231- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 235- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 241- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 294- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 469- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 499- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 580- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 616- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 634- }- ]- },- {- "event": "voice:idle",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useOpenWorldData.js",- "line": 280- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 171- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 251- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 263- }- ]- },- {- "event": "voice:interrupt",- "directions": [- "client-to-server",- "server-to-client"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 472- },- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 575- },- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 913- },- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 1114- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 245- },- {- "direction": "server-to-client",- "source": "server/sockets/voice.js",- "line": 522- }- ]- },- {- "event": "voice:output:available",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 409- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 379- }- ]- },- {- "event": "voice:output:claim",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 400- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 387- }- ]- },- {- "event": "voice:output:detached",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/services/voiceClient.js",- "line": 426- }- ]- },- {- "event": "voice:output:primary",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/services/voiceClient.js",- "line": 421- },- {- "direction": "server-to-client",- "source": "server/services/voice/voiceOutput.js",- "line": 91- }- ]- },- {- "event": "voice:reset",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 580- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 254- }- ]- },- {- "event": "voice:screenshot:result",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 692- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 339- }- ]- },- {- "event": "voice:speak",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/services/voiceClient.js",- "line": 364- },- {- "direction": "server-to-client",- "source": "server/services/voice/voiceOutput.js",- "line": 4- }- ]- },- {- "event": "voice:text",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 537- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 221- }- ]- },- {- "event": "voice:transcript",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/services/voiceClient.js",- "line": 467- }- ]- },- {- "event": "voice:tts:audio",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/services/voiceClient.js",- "line": 343- }- ]- },- {- "event": "voice:turn",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 529- },- {- "direction": "client-to-server",- "source": "client/src/services/voiceClient.js",- "line": 846- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 187- }- ]- },- {- "event": "voice:ui:index",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useVoiceUiSync.js",- "line": 79- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 302- }- ]- },- {- "event": "voice:ui:read-request",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/hooks/useVoiceUiSync.js",- "line": 101- }- ]- },- {- "event": "voice:ui:read-response",- "directions": [- "client-to-server"- ],- "sources": [- {- "direction": "client-to-server",- "source": "client/src/hooks/useVoiceUiSync.js",- "line": 99- },- {- "direction": "client-to-server",- "source": "server/sockets/voice.js",- "line": 357- }- ]- },- {- "event": "writers-room:scene-image",- "directions": [- "server-to-client"- ],- "sources": [- {- "direction": "server-to-client",- "source": "client/src/components/writers-room/LiveRenderPanel.jsx",- "line": 144- },- {- "direction": "server-to-client",- "source": "server/services/socket.js",- "line": 279- }- ]- }- ],- "stats": {- "events": 280,- "clientToServer": 72,- "serverToClient": 217,- "bidirectional": 9,- "sourceFiles": 108- }-}diff --git a/server/lib/socketEventCatalog.js b/server/lib/socketEventCatalog.jsindex ecbc72c4bf..5ad082a0ee 100644--- a/server/lib/socketEventCatalog.js+++ b/server/lib/socketEventCatalog.js@@ -1,12 +1,7 @@-/** Searchable projection of the generated Socket.IO call-site inventory. */+/** Searchable projection of the source-derived Socket.IO event inventory. */-import { readFileSync } from 'node:fs';import { socketEventContract } from './socketEventContracts.js';--const manifest = JSON.parse(readFileSync(- new URL('./socketEventCatalog.generated.json', import.meta.url),- 'utf8',-));+import { getSocketEventInventory } from './socketEventInventory.js';const titleCase = (value) => value.replace(/[-_]+/g, ' ')@@ -14,8 +9,9 @@ const titleCase = (value) => valueexport const socketDomainForEvent = (event) => event.split(':', 1)[0] || 'socket';-export const buildSocketEventCatalog = () => {- const events = manifest.events.map((event) => {+export const buildSocketEventCatalog = async ({ inventory = getSocketEventInventory() } = {}) => {+ const resolvedInventory = await inventory;+ const events = resolvedInventory.events.map((event) => {const domain = socketDomainForEvent(event.event);const contracts = Object.fromEntries(event.directions.flatMap((direction) => {const contract = socketEventContract(event.event, direction);@@ -36,10 +32,9 @@ export const buildSocketEventCatalog = () => {.map((id) => ({ id, label: titleCase(id), events: events.filter((event) => event.domain === id).length }));const modeled = events.filter((event) => event.contractStatus === 'modeled').length;return {- schemaVersion: 1,- generatedFrom: manifest.generatedFrom,- regenerateCommand: 'node scripts/generate-socket-event-catalog.js',- stats: { ...manifest.stats, domains: domains.length, modeled, generated: events.length - modeled },+ schemaVersion: 2,+ derivedFrom: resolvedInventory.derivedFrom,+ stats: { ...resolvedInventory.stats, domains: domains.length, modeled, generated: events.length - modeled },domains,events,};diff --git a/server/lib/socketEventCatalog.test.js b/server/lib/socketEventCatalog.test.jsindex 5f3258f4dc..05fa525e3e 100644--- a/server/lib/socketEventCatalog.test.js+++ b/server/lib/socketEventCatalog.test.js@@ -2,10 +2,13 @@ import { describe, expect, it } from 'vitest';import { buildSocketEventCatalog } from './socketEventCatalog.js';describe('socket event catalog', () => {- it('projects domains, directions, source pointers, and runtime-backed coverage', () => {- const catalog = buildSocketEventCatalog();+ it('projects domains, directions, and runtime-backed coverage without positional metadata', async () => {+ const catalog = await buildSocketEventCatalog();+ expect(catalog.schemaVersion).toBe(2);expect(catalog.stats.events).toBeGreaterThan(100);expect(catalog.stats.modeled).toBeGreaterThan(10);+ expect(catalog).not.toHaveProperty('regenerateCommand');+ expect(catalog.events.every((event) => !('sources' in event) && !('line' in event))).toBe(true);expect(catalog.domains.find((domain) => domain.id === 'cos').events).toBeGreaterThan(5);expect(catalog.events.find((event) => event.event === 'shell:input')).toMatchObject({contractStatus: 'modeled',diff --git a/server/lib/socketEventInventory.js b/server/lib/socketEventInventory.jsnew file mode 100644index 0000000000..418ce30923--- /dev/null+++ b/server/lib/socketEventInventory.js@@ -0,0 +1,123 @@+/** Source-derived Socket.IO event inventory, cached once per server process. */++import { readFile, readdir } from 'node:fs/promises';+import { dirname, join, relative, resolve, sep } from 'node:path';+import { fileURLToPath } from 'node:url';+import { mapWithConcurrency } from './mapWithConcurrency.js';++const DEFAULT_REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../..');+const SERVER_ROOT = 'server';+const CLIENT_ROOT = 'client/src';+const FILE_READ_CONCURRENCY = 32;+const EXCLUDED_DIRECTORY_NAMES = new Set(['node_modules', 'coverage', 'dist']);+const EXCLUDED_SERVER_PREFIXES = Object.freeze(['server/cos-runner/']);+const SOCKET_CALL_RE = /\bsocket\??\.(on|once|emit)\(\s*(`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/g;+const SERVER_EMIT_RE = /\b(?:io|ioInstance)\??\.emit\(\s*(`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/g;+const SERVER_BROADCAST_RE = /\bbroadcastTo(?!Set\b)[A-Za-z]*\(\s*(`(?:[^`\\]|\\.)*`|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/g;+const REGISTER_SUBSCRIBER_RE = /\bregisterSubscriber\(\s*socket\s*,\s*(['"])([^'"\n]+)\1/g;++const toPosix = (path) => path.split(sep).join('/');++const walk = async (path) => (await Promise.all(+ (await readdir(path, { withFileTypes: true }))+ .filter((entry) => !EXCLUDED_DIRECTORY_NAMES.has(entry.name))+ .map(async (entry) => {+ const target = join(path, entry.name);+ return entry.isDirectory() ? walk(target) : [target];+ }),+)).flat();++const sourceFiles = async (repoRoot) => (await Promise.all([+ walk(join(repoRoot, SERVER_ROOT)),+ walk(join(repoRoot, CLIENT_ROOT)),+])).flat().filter((path) => {+ const relativePath = toPosix(relative(repoRoot, path));+ return /\.(?:js|jsx)$/.test(path)+ && !path.endsWith('.test.js')+ && !path.endsWith('.test.jsx')+ && !EXCLUDED_SERVER_PREFIXES.some((prefix) => relativePath.startsWith(prefix));+});++const parseEventExpression = (expression) => {+ const quote = expression[0];+ const body = expression.slice(1, -1);+ if (quote !== '`') return body;+ if (/\$\{(?![A-Za-z_$][\w$]*\})/.test(body)) return null;+ const normalized = body.replace(/\$\{([A-Za-z_$][\w$]*)\}/g, '{$1}');+ // A leading placeholder is an internal helper pattern (for example+ // `${namespace}:subscribed`), not a callable address. Concrete call sites+ // and registerSubscriber expansion contribute the real event names.+ return normalized.startsWith('{') ? null : normalized;+};++const directionFor = ({ side, method }) => {+ if (side === 'server') return method === 'emit' ? 'server-to-client' : 'client-to-server';+ return method === 'emit' ? 'client-to-server' : 'server-to-client';+};++export async function scanSocketEventFile(filePath, repoRoot = DEFAULT_REPO_ROOT) {+ const source = await readFile(filePath, 'utf8');+ const path = toPosix(relative(repoRoot, filePath));+ const side = path.startsWith('server/') ? 'server' : 'client';+ const declarations = [];+ const record = (match, method, expression = match[2]) => {+ const event = parseEventExpression(expression);+ if (event) declarations.push({ event, direction: directionFor({ side, method }) });+ };++ for (const match of source.matchAll(SOCKET_CALL_RE)) record(match, match[1]);+ if (side === 'server') {+ for (const match of source.matchAll(SERVER_EMIT_RE)) record(match, 'emit', match[1]);+ for (const match of source.matchAll(SERVER_BROADCAST_RE)) record(match, 'emit', match[1]);+ for (const match of source.matchAll(REGISTER_SUBSCRIBER_RE)) {+ for (const suffix of ['subscribe', 'unsubscribe']) {+ declarations.push({ event: `${match[2]}:${suffix}`, direction: 'client-to-server' });+ }+ for (const suffix of ['subscribed', 'unsubscribed']) {+ declarations.push({ event: `${match[2]}:${suffix}`, direction: 'server-to-client' });+ }+ }+ }+ return declarations;+}++export async function buildSocketEventInventory({ repoRoot = DEFAULT_REPO_ROOT } = {}) {+ const byEvent = new Map();+ let sourceFileCount = 0;+ const files = await sourceFiles(repoRoot);+ const declarationSets = await mapWithConcurrency(+ files,+ FILE_READ_CONCURRENCY,+ (filePath) => scanSocketEventFile(filePath, repoRoot),+ );+ for (const declarations of declarationSets) {+ if (declarations.length) sourceFileCount += 1;+ for (const declaration of declarations) {+ const directions = byEvent.get(declaration.event) || new Set();+ directions.add(declaration.direction);+ byEvent.set(declaration.event, directions);+ }+ }++ const events = [...byEvent.entries()]+ .map(([event, directions]) => ({ event, directions: [...directions].sort() }))+ .sort((a, b) => a.event.localeCompare(b.event));+ return {+ derivedFrom: ['server/**/*.js', '!server/cos-runner/**', 'client/src/**/*.{js,jsx}'],+ events,+ stats: {+ events: events.length,+ clientToServer: events.filter((event) => event.directions.includes('client-to-server')).length,+ serverToClient: events.filter((event) => event.directions.includes('server-to-client')).length,+ bidirectional: events.filter((event) => event.directions.length > 1).length,+ sourceFiles: sourceFileCount,+ },+ };+}++let cachedInventoryPromise;++export const getSocketEventInventory = () => {+ cachedInventoryPromise ??= buildSocketEventInventory();+ return cachedInventoryPromise;+};diff --git a/server/lib/socketEventInventory.test.js b/server/lib/socketEventInventory.test.jsnew file mode 100644index 0000000000..061e6343a0--- /dev/null+++ b/server/lib/socketEventInventory.test.js@@ -0,0 +1,79 @@+import { describe, expect, it } from 'vitest';+import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join } from 'node:path';+import {+ buildSocketEventInventory,+ getSocketEventInventory,+ scanSocketEventFile,+} from './socketEventInventory.js';++const write = (root, path, source) => {+ const target = join(root, path);+ mkdirSync(join(target, '..'), { recursive: true });+ writeFileSync(target, source, 'utf8');+};++describe('Socket.IO event inventory', () => {+ it('merges client/server declarations and normalizes bounded template events', async () => {+ const root = mkdtempSync(join(tmpdir(), 'portos-socket-inventory-'));+ write(root, 'server/services/socket.js', `+ socket.on('demo:start', handler);+ io.emit('demo:done', data);+ io?.emit('demo:optional', data);+ socket.emit(\`demo:step:\${kind}\`, data);+ `);+ write(root, 'server/sockets/empty.js', 'export default {};');+ write(root, 'client/src/demo.jsx', `+ socket.emit('demo:start', {});+ socket.on('demo:done', handler);+ `);+ const inventory = await buildSocketEventInventory({ repoRoot: root });+ expect(inventory.events.find((event) => event.event === 'demo:start').directions).toEqual(['client-to-server']);+ expect(inventory.events.find((event) => event.event === 'demo:done').directions).toEqual(['server-to-client']);+ expect(inventory.events.map((event) => event.event)).toContain('demo:optional');+ expect(inventory.events.map((event) => event.event)).toContain('demo:step:{kind}');+ expect(inventory.events.every((event) => !('sources' in event) && !('line' in event))).toBe(true);+ });++ it('classifies client lifecycle listeners and excludes the isolated runner tree', async () => {+ const root = mkdtempSync(join(tmpdir(), 'portos-socket-file-'));+ write(root, 'server/sockets/empty.js', 'export default {};');+ write(root, 'server/cos-runner/isolated.js', `socket.emit('runner:internal');`);+ write(root, 'client/src/socket.js', `socket.on('connect', handler); socket.emit('shell:start', {});`);+ expect(await scanSocketEventFile(join(root, 'client/src/socket.js'), root)).toEqual([+ { event: 'connect', direction: 'server-to-client' },+ { event: 'shell:start', direction: 'client-to-server' },+ ]);+ expect((await buildSocketEventInventory({ repoRoot: root })).events.map((event) => event.event))+ .not.toContain('runner:internal');+ });++ it('derives a unique current inventory with representative lifecycle events', async () => {+ const inventory = await buildSocketEventInventory();+ expect(inventory.stats.events).toBeGreaterThan(100);+ expect(new Set(inventory.events.map((event) => event.event)).size).toBe(inventory.events.length);+ const names = new Set(inventory.events.map((event) => event.event));+ for (const event of [+ 'cos:mind:event',+ 'cos:subscribe',+ 'voice:text',+ 'shell:start',+ 'image-gen:completed',+ 'error:occurred',+ 'backup:failed',+ 'calendar:sync:started',+ 'digital-twin:test-progress',+ 'sharing:inbox-updated',+ ]) {+ expect(names.has(event), event).toBe(true);+ }+ });++ it('shares the first-use scan across the server process', async () => {+ const first = getSocketEventInventory();+ const second = getSocketEventInventory();+ expect(second).toBe(first);+ expect((await first).stats.events).toBeGreaterThan(100);+ });+});diff --git a/server/routes/apiDocs.js b/server/routes/apiDocs.jsindex 3a84bde924..1e26009af5 100644--- a/server/routes/apiDocs.js+++ b/server/routes/apiDocs.js@@ -52,14 +52,14 @@ router.get('/catalog.json', asyncHandler(async (_req, res) => {}));// GET /api/api-docs/events.json — searchable Socket.IO event metadata.-router.get('/events.json', (_req, res) => {- res.json(buildSocketEventCatalog());-});+router.get('/events.json', asyncHandler(async (_req, res) => {+ res.json(await buildSocketEventCatalog());+}));// GET /api/api-docs/asyncapi.json — AsyncAPI 3 for the Socket.IO transport.router.get('/asyncapi.json', asyncHandler(async (req, res) => {const version = await getCurrentVersion();- res.json(buildAsyncApiSpec({ baseUrl: baseUrlFromReq(req), version }));+ res.json(await buildAsyncApiSpec({ baseUrl: baseUrlFromReq(req), version }));}));// GET /api/api-docs/tools.min.json — the minimized semantic tool resource.diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.jsindex c8a0eea42f..03c7188599 100644--- a/server/services/taskPromptDefaults.test.js+++ b/server/services/taskPromptDefaults.test.js@@ -35,6 +35,19 @@ const SNAPSHOT = JSON.parse(readFileSync());describe('taskPromptDefaults integrity snapshot', () => {+ it('code-quality v3 inventories structural drift while preserving v2', () => {+ const current = DEFAULT_TASK_PROMPTS['code-quality'];+ const previous = PREVIOUS_DEFAULT_PROMPTS['code-quality'][0];++ expect(PROMPT_VERSIONS['code-quality']).toBe(3);+ expect(current).toContain('Derived artifacts committed as a second source of truth');+ expect(current).toContain('volatile line/column/offset');+ expect(current).toContain('regeneration-only churn');+ expect(current).toContain('Incidental-layout coupling');+ expect(previous).toContain('Find DRY violations');+ expect(previous).not.toBe(current);+ });+it('claim workflows avoid Copilot and require verified remote merge state before cleanup', () => {for (const key of ['plan-task', 'claim-issue']) {const prompt = DEFAULT_TASK_PROMPTS[key];diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.jsonindex 643e723f2e..6f3057c2c8 100644--- a/server/services/taskPromptDefaults/integrity.snapshot.json+++ b/server/services/taskPromptDefaults/integrity.snapshot.json@@ -1,7 +1,7 @@{"DEFAULT_TASK_PROMPTS": {"security": "8e58c1305a391ac765b0b13ab9615eb3",- "code-quality": "5d86db04077cf0b0d190b62db1c5581d",+ "code-quality": "c34792a374dd9868e6381557da582dc1","test-coverage": "0d8359170529da12cd63356610b2e220","performance": "672bd3958b12afb0f382bcebb6dc3b33","accessibility": "372916803f32b82da38a5b2130a54baf",@@ -60,7 +60,7 @@"refresh-local-llm-catalog": 4,"plan-feature": 5,"security": 2,- "code-quality": 2,+ "code-quality": 3,"test-coverage": 2,"performance": 2,"accessibility": 2,diff --git a/server/services/taskPromptDefaults/previousDefaults.js b/server/services/taskPromptDefaults/previousDefaults.jsindex ec5cb326a6..9eb25d9390 100644--- a/server/services/taskPromptDefaults/previousDefaults.js+++ b/server/services/taskPromptDefaults/previousDefaults.js@@ -9267,7 +9267,7 @@ Analyze PortOS codebase for security vulnerabilities:Fix any vulnerabilities and commit with security advisory notes.`,],'code-quality': [- // Outgoing pre-unification default, app-improvement schedule.+ // Outgoing v2 default (also the pre-unification app-improvement default).`[App Improvement: {appName}] Code Quality ReviewAnalyze {appName} for maintainability improvements:diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.jsindex 6379f3bc27..cd1d6debe2 100644--- a/server/services/taskPromptDefaults/prompts.js+++ b/server/services/taskPromptDefaults/prompts.js@@ -85,21 +85,47 @@ Repository: {repoPath}Fix any vulnerabilities found and commit with security advisory notes.`,- 'code-quality': `[Improvement: {appName}] Code Quality Review+ 'code-quality': `[Improvement: {appName}] Code Quality and Structural Drift Review-Analyze {appName} for maintainability improvements:+Audit {appName} for maintainability failures that create real operational or+engineering cost.Repository: {repoPath}-1. Find DRY violations - similar code in multiple places-2. Identify functions >50 lines that should be split-3. Look for missing error handling-4. Find dead code and unused imports-5. Check for console.log that should be removed-6. Look for TODO/FIXME that need addressing-7. Identify magic numbers that should be constants+{modeInstructions}-Focus on the main source directories. Refactor issues found and commit improvements.`,+Start with a cheap repository-wide inventory of candidates, then choose one+bounded, coherent slice and trace it deeply. Hunt specifically for:++1. **Derived artifacts committed as a second source of truth** — generated+ catalogs, manifests, snapshots, indexes, or caches that copy facts already+ available from source. Pay special attention to volatile line/column/offset,+ timestamp, absolute-path, or ordering metadata that changes when behavior+ does not. Check history for regeneration-only churn and determine whether the+ value can instead be derived at build time, startup, or first use and cached.+2. **Manually synchronized registries** — the same routes, events, commands,+ schemas, feature flags, or capabilities listed in multiple places, with a+ drift test merely telling a human to copy one representation into another.+ Prefer one semantic registry consumed by every projection. When a second+ registry would only duplicate hundreds of real declarations, derive the+ projection from those declarations and cache it; use source scans as CI+ guards for protocols whose call sites already consume a canonical registry.+3. **Incidental-layout coupling** — tests, manifests, or runtime behavior tied to+ source line numbers, array positions, object insertion order, filenames, or+ other coordinates that are not part of the product contract.+4. **Architecture and ownership leaks** — one concern split across unrelated+ layers, helpers that reverse dependency direction, ad-hoc conditionals bolted+ onto a generic flow, or wrappers that add indirection without policy.+5. **Conventional code-quality defects** — duplicated logic, functions that mix+ unrelated concerns, dead code, unused imports, stale TODOs, missing boundary+ error handling, noisy debug logging, and unexplained magic values.++For every candidate, read the producer, all consumers, its tests, and recent+history before judging it. A checked-in generated artifact can be legitimate+when distribution lacks the source, derivation is expensive or nondeterministic,+or reproducible releases require frozen bytes. Do not file or implement a+subjective rewrite. Keep only findings with a named transformation and proven+impact: runtime/data failure, CI or release failure, or recurring manual churn.`,'test-coverage': `[Improvement: {appName}] Improve Test Coveragediff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.jsindex 4ca55ca957..079b174cf6 100644--- a/server/services/taskPromptDefaults/versions.js+++ b/server/services/taskPromptDefaults/versions.js@@ -31,7 +31,7 @@ export const PROMPT_VERSIONS = {// current {appName} body. See PREVIOUS_DEFAULT_PROMPTS + the self-heal in// taskSchedule.js loadSchedule().'security': 2, // v2: generic {appName} body (older default hardcoded "PortOS"/"server/routes" paths)- 'code-quality': 2, // v2: generic {appName} body (older default hardcoded "PortOS")+ 'code-quality': 3, // v3: inventory structural drift, duplicate sources of truth, volatile generated artifacts, and incidental-layout coupling before conventional maintainability checks. v2: generic {appName} body (older default hardcoded "PortOS")'test-coverage': 2, // v2: generic {appName} body (older default hardcoded "PortOS")'performance': 2, // v2: generic {appName} body (older default hardcoded "PortOS")'accessibility': 2, // v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)