AnasSarkiz/tscircuit-ai-agent-remote

A mixed embedded-audio PCB component library featuring ESP32-S3 control, digital microphones, I²S audio amplification, power/battery management, USB protection, logic interfaces, connectors, switches, MOSFETs, diodes, and assorted passive components.

Version
0.0.11-wip-generator-qualification
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone AnasSarkiz/tscircuit-ai-agent-remote  # download the package files into ./tscircuit-ai-agent-remote
tsci add AnasSarkiz/tscircuit-ai-agent-remote    # add it to your project as @tsci/AnasSarkiz.tscircuit-ai-agent-remote

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

src/board/ManualSignalPaths.tsx

import { pcbPath } from "@tscircuit/props"
import { z } from "zod"
import manualPaths from "./manual-signal-paths.json"
import { ManualInnerSignalCopper, relocatedSignalPathIndices } from "./ManualInnerSignalCopper"
import { retiredManualConnectionPathIndices } from "./ManualConnectionCopper"

const manualTrace = z.object({
  net: z.string(),
  from: z.string(),
  to: z.string(),
  width: z.number().positive(),
  pcbPath,
})
const paths = manualTrace.array().parse(manualPaths.paths)
const retiredSourcePathIndices = new Set(
  z
    .object({
      retired_source_path_indices: z
        .array(
          z
            .number()
            .int()
            .min(0)
            .max(paths.length - 1),
        )
        .default([]),
    })
    .parse(manualPaths).retired_source_path_indices,
)

// Deliberately authored native paths, never represented as autorouter caches.
export function ManualSignalPaths({ placementOnly = false }: { placementOnly?: boolean } = {}) {
  if (placementOnly) return null
  return (
    <>
      {paths.map((path, index) =>
        retiredSourcePathIndices.has(index) ? null : (
          <trace
            key={`${path.net}-${index}`}
            name={`MANUAL_${path.net}_${index}`}
            from={path.from}
            to={path.to}
            width={path.width}
            pcbPathRelativeTo={path.from}
            pcbPath={
              relocatedSignalPathIndices.has(index) || retiredManualConnectionPathIndices.has(index)
                ? undefined
                : path.pcbPath
            }
          />
        ),
      )}
      <ManualInnerSignalCopper />
    </>
  )
}