Lines 3-50javascript
3// generate-dashboard.mjs — oh-my-hi dashboard generator
6 * @typedef {{ id: string, label: string, type: 'global'|'project',
7 * configPath: string, projectPath: string|null }} Scope
11 * @typedef {{ globalClaudeTokens: number, projectClaudeTokens: number,
12 * autoMemoryTokens: number, skillsDescTokens: number,
13 * mcpToolsTokens: number, principlesTokens: number }} ContextStats
17 * @typedef {{ usage: import('./parsers/usage.mjs').UsageResult,
18 * contextStats: ContextStats,
19 * dateRange: { start: number|null, end: number|null } }} ScopeData
21import { fileURLToPath } from 'url';
22import path from 'path';
24import { execSync, spawnSync, spawn } from 'child_process';
25
HighSandbox Evasion Gated Capability
Source gates dangerous network, credential, or execution behavior behind CI, host, platform, time, or geo fingerprint checks.
scripts/generate-dashboard.mjsView on unpkg · L23 HighCross File Remote Execution Context
Source spawns a local helper that also contains network and dynamic execution context; review data flow before blocking.
scripts/generate-dashboard.mjsView on unpkg · L23 26// Auto-install dependencies if missing
27const __boot_dir = path.dirname(fileURLToPath(import.meta.url));
28const __boot_root = path.resolve(__boot_dir, '..');
29if (!fs.existsSync(path.join(__boot_root, 'node_modules'))) {
30 console.log('oh-my-hi: installing dependencies...');
31 execSync('npm install --omit=dev', { cwd: __boot_root, stdio: 'inherit' });
32}
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
scripts/generate-dashboard.mjsView on unpkg · L30 34const { transformSync } = await import('esbuild');
36import { parseSkills } from './parsers/skills.mjs';
37import { parseAgents } from './parsers/agents.mjs';
38import { parsePlugins } from './parsers/plugins.mjs';
39import { parseHooks } from './parsers/hooks.mjs';
40import { parseMemory } from './parsers/memory.mjs';
41import { parseMcpServers } from './parsers/mcp-servers.mjs';
42import { parseRules, parsePrinciples } from './parsers/rules.mjs';
43import { parseCommands } from './parsers/commands.mjs';
44import { parseTeams } from './parsers/teams.mjs';
45import { parsePlans } from './parsers/plans.mjs';
46import { parseTodos } from './parsers/todos.mjs';
47import { parseConfigFiles } from './parsers/config-files.mjs';
48import { lintScope } from './parsers/lint.mjs';
49import { parseUsage, loadMtimeIndex, saveMtimeIndex, scanTranscriptMonths } from './parsers/usage.mjs';
50import { detectScopes } from './parsers/scopes.mjs';