Skip to content

sykk/ircx / scripts/run-ircx

run-ircx

Verified

Build, run, and drive ircx. Use when asked to start ircx, run its tests, build it, take a screenshot of its UI, click through the app, or check that a frontend change works in the running client.

FileKindSize
SKILL.mdskill md20.7 KB
driver.mjsscript14.2 KB
quickserver.mjsscript4.5 KB
seed.mjsscript13.0 KB
shift.pyscript2.1 KB
soak.mjsscript10.2 KB
startup.mjsscript11.2 KB
vite.browser.config.mjsscript2.7 KB
window.mjsscript16.9 KB
xsend.cother5.2 KB

vite.browser.config.mjs

View on GitHub
// Vite config for driving the ircx frontend in a plain browser.
//
// The app normally runs inside a Tauri webview, where `window.__TAURI_INTERNALS__`
// exists. Several call sites reach for it without checking — `onFileDrop` in
// src/lib/ipc.ts calls `getCurrentWindow()` the moment <DropToUpload> mounts —
// and the resulting synchronous throw unmounts the whole React tree, leaving a
// window that is the right colour and completely empty.
//
// So this injects just enough of those globals for the app to mount, with every
// `invoke` rejecting. Rejecting is the honest answer: it is the backend-absent
// path the app already handles (startThemes falls back to the built-in themes,
// the bridge reports that it could not reach its backend), so what renders is
// the real UI in a real degraded state rather than a mock.
//
// With `--seeded` the driver sets `IRCX_SEEDED` and `seed.mjs` answers instead,
// so the parts of the client that need a conversation can be walked at all. The
// rejecting stub stays the default: it is the state the app is designed to
// degrade into, and a walk of the shell should see it.
//
// This file exists so none of that has to be patched into the repo. It wraps the
// project's own config rather than restating it, so a change to the port, the
// alias or the plugin list is picked up here too.
import { fileURLToPath } from "node:url";
import base from "../../vite.config.ts";
import { SEED } from "./seed.mjs";

const STUB = `
window.__TAURI_INTERNALS__ = {
  metadata: {
    currentWindow: { label: "main" },
    currentWebview: { label: "main" },
  },
  transformCallback: (cb) => {
    const id = Math.floor(Math.random() * 1e9);
    window["_" + id] = cb;
    return id;
  },
  invoke: () => Promise.reject("no backend: the frontend is running in a browser"),
};
`;

const stub = process.env.IRCX_SEEDED ? SEED : STUB;

/** Vite resolves `base` lazily when it is a function; the project's is an
 * object, so it is spread directly. */
const config = typeof base === "function" ? base({ command: "serve", mode: "development" }) : base;

export default {
  ...config,
  configFile: false,
  root: fileURLToPath(new URL("../../", import.meta.url)),
  plugins: [
    ...(config.plugins ?? []),
    {
      name: "ircx-tauri-stub",
      transformIndexHtml: {
        order: "pre",
        handler: (html) => html.replace("<head>", `<head><script>${stub}</script>`),
      },
    },
  ],
  server: {
    ...config.server,
    // The project pins 5183 with strictPort so Tauri's devUrl cannot drift.
    // A driver that inherited that would collide with a Tauri dev server, or
    // with another agent's, and fail to start. Port 0 asks for a free one.
    port: 0,
    strictPort: false,
  },
};
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall