mcltspice/docs/astro.config.mjs
Ryan Malloy 37caaf0310 Add native macOS support (no Wine) per Kevin's spec
Platform-branches the Wine-specific execution so Linux behaves identically
while macOS drives LTspice.app natively. Implemented from muel9560's measured
spec + validated where possible against a Wine -netlist oracle on Linux.

- config.py: get_launch() abstraction (argv prefix + env + path translator);
  IS_DARWIN, LTSPICE_BIN (env-overridable), LTSPICE_LIB_ROOT under
  ~/Library/Application Support/LTspice on macOS. Linux resolves to the
  historical Wine paths unchanged.
- runner.py: darwin branch uses the native binary, POSIX paths (no Z: map),
  plain -b (never -Run), and completion by polling for a stable .raw (the Mac
  GUI app's exit code is unreliable). Linux keeps communicate()+wait_for.
- netlister.py (new): asc_to_netlist() converts a schematic to a netlist on
  macOS, since the Mac CLI can't netlist a .asc. Union-find net extraction;
  all 15 templates netlist, topology matches the Wine -netlist oracle.
- library_tools.py: check_installation reports platform/binary/lib-root/
  version/gui-session on macOS.
- packaging/docs: drop 'Linux only'; document LTSPICE_BIN + GUI-session need.

Adversarial review fixes: restore kill+reap of the Wine subprocess on Linux
timeout (was orphaning the process -- a real regression); alias duplicate net
labels instead of aborting (sallen-key); synthesize NC_xx nodes for floating
pins (op-amps) to match the oracle; use asyncio.get_running_loop().

Linux unaffected: 476 unit + 10 integration (real Wine) still pass; +48 unit
+8 integration for the platform/netlister paths. macOS runtime (LTspice.app
invocation, GUI session, poll timing) needs validation on Kevin's hardware.
2026-07-03 12:35:18 -06:00

88 lines
3.1 KiB
JavaScript

import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
import tailwindcss from '@tailwindcss/vite';
export default defineConfig({
site: 'https://mcltspice.warehack.ing',
telemetry: false,
devToolbar: { enabled: false },
integrations: [
starlight({
title: 'mcltspice',
tagline: 'LTspice circuit simulation via MCP',
components: {
Hero: './src/components/Hero.astro',
SocialIcons: './src/components/SocialIcons.astro',
Footer: './src/components/Footer.astro',
},
social: [
{ icon: 'external', label: 'Gitea', href: 'https://git.supported.systems/MCP/mcltspice' },
{ icon: 'external', label: 'PyPI', href: 'https://pypi.org/project/mcltspice/' },
],
editLink: {
baseUrl: 'https://git.supported.systems/MCP/mcltspice/_edit/main/docs/',
},
customCss: ['./src/styles/custom.css'],
sidebar: [
{
label: 'Getting Started',
items: [
{ label: 'Overview', slug: 'getting-started' },
{ label: 'Prerequisites', slug: 'getting-started/prerequisites' },
{ label: 'Claude Code Setup', slug: 'getting-started/claude-code' },
{ label: 'First Simulation', slug: 'getting-started/first-simulation' },
],
},
{
label: 'Tutorials',
badge: { text: 'Learn', variant: 'tip' },
items: [
{ label: 'Overview', slug: 'tutorials' },
{ label: 'Design a Filter', slug: 'tutorials/design-a-filter' },
{ label: 'Monte Carlo Yield', slug: 'tutorials/monte-carlo-yield' },
{ label: 'Publish to SpiceBook', slug: 'tutorials/publish-to-spicebook' },
],
},
{
label: 'Reference',
collapsed: false,
items: [
{ label: 'Overview', slug: 'reference' },
{ label: 'Simulation', slug: 'reference/simulation' },
{ label: 'Waveform', slug: 'reference/waveform' },
{ label: 'Signal Analysis', slug: 'reference/signal-analysis' },
{ label: 'Noise', slug: 'reference/noise' },
{ label: 'Stability & Power', slug: 'reference/stability-power' },
{ label: 'Schematic & Netlist', slug: 'reference/schematic-netlist' },
{ label: 'Library & Templates', slug: 'reference/library-templates' },
{ label: 'SpiceBook', slug: 'reference/spicebook', badge: { text: 'New', variant: 'note' } },
{ label: 'Resources', slug: 'reference/resources' },
{ label: 'Prompts', slug: 'reference/prompts' },
],
},
{
label: 'Concepts',
collapsed: true,
items: [
{ label: 'How it works', slug: 'concepts/ltspice-on-linux' },
{ label: 'Simulation Types', slug: 'concepts/simulation-types' },
],
},
],
}),
],
vite: {
plugins: [tailwindcss()],
server: {
host: '0.0.0.0',
...(process.env.VITE_HMR_HOST && {
hmr: {
host: process.env.VITE_HMR_HOST,
protocol: 'wss',
clientPort: 443,
},
}),
},
},
});