@tscircuit/runframe 0.0.586 → 0.0.587

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -356,7 +356,9 @@ var ErrorTabContent = ({
356
356
  circuitJsonWarnings,
357
357
  onReportAutoroutingLog,
358
358
  errorMessage,
359
- errorStack
359
+ errorStack,
360
+ circuitJson,
361
+ evalVersion
360
362
  }) => {
361
363
  const unifiedErrors = useMemo(() => {
362
364
  const errors = [];
@@ -380,6 +382,13 @@ var ErrorTabContent = ({
380
382
  }
381
383
  return errors;
382
384
  }, [errorMessage, errorStack, circuitJsonErrors]);
385
+ const softwareUsedString = useMemo(() => {
386
+ if (!circuitJson || !Array.isArray(circuitJson)) return void 0;
387
+ const metadata = circuitJson.find(
388
+ (el) => el.type === "source_project_metadata"
389
+ );
390
+ return metadata?.software_used_string;
391
+ }, [circuitJson]);
383
392
  const unifiedWarnings = useMemo(() => {
384
393
  const warnings = [];
385
394
  if (circuitJsonWarnings && circuitJsonWarnings.length > 0) {
@@ -460,12 +469,18 @@ var ErrorTabContent = ({
460
469
  currentError && /* @__PURE__ */ jsx6("div", { className: "rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200 rf-max-h-[500px] rf-overflow-y-auto rf-px-2", children: /* @__PURE__ */ jsxs4("div", { className: "rf-p-4", children: [
461
470
  /* @__PURE__ */ jsx6("h3", { className: "rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-1", children: currentError.type }),
462
471
  /* @__PURE__ */ jsx6("p", { className: "rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600", children: currentError.message }),
463
- currentError.stack && /* @__PURE__ */ jsx6(
472
+ (currentError.stack || evalVersion || softwareUsedString) && /* @__PURE__ */ jsxs4(
464
473
  "details",
465
474
  {
466
475
  style: { whiteSpace: "pre-wrap" },
467
476
  className: "rf-text-xs rf-font-mono rf-text-red-600 rf-mt-2",
468
- children: currentError.stack
477
+ children: [
478
+ evalVersion && `@tscircuit/eval@${evalVersion}
479
+ `,
480
+ softwareUsedString && `${softwareUsedString}
481
+ `,
482
+ currentError.stack
483
+ ]
469
484
  }
470
485
  )
471
486
  ] }) }),
@@ -526,7 +541,13 @@ var ErrorTabContent = ({
526
541
  variant: "outline",
527
542
  className: "rf-p-1",
528
543
  onClick: () => {
529
- const errorText = `${currentError.type}: ${currentError.message}${currentError.stack ? "\n" + currentError.stack : ""}`;
544
+ let errorText = `${currentError.type}: ${currentError.message}`;
545
+ if (evalVersion) errorText += `
546
+ @tscircuit/eval@${evalVersion}`;
547
+ if (softwareUsedString) errorText += `
548
+ ${softwareUsedString}`;
549
+ if (currentError.stack) errorText += `
550
+ ${currentError.stack}`;
530
551
  navigator.clipboard.writeText(errorText);
531
552
  alert("Error copied to clipboard!");
532
553
  },
@@ -544,7 +565,13 @@ var ErrorTabContent = ({
544
565
  onClick: () => {
545
566
  const title = `Error ${currentError.type}`.replace(/[^a-zA-Z0-9 ]/g, " ").replace(/\s+/g, " ").slice(0, 100);
546
567
  const url = createSnippetUrl(code ?? "");
547
- const errorDetails = `${currentError.type}: ${currentError.message}${currentError.stack ? "\n" + currentError.stack : ""}`;
568
+ let errorDetails = `${currentError.type}: ${currentError.message}`;
569
+ if (evalVersion) errorDetails += `
570
+ @tscircuit/eval@${evalVersion}`;
571
+ if (softwareUsedString) errorDetails += `
572
+ ${softwareUsedString}`;
573
+ if (currentError.stack) errorDetails += `
574
+ ${currentError.stack}`;
548
575
  let body = `[Package code to reproduce](${url})
549
576
 
550
577
  ### Error
@@ -1187,7 +1214,22 @@ var RenderLogViewer = ({
1187
1214
  };
1188
1215
 
1189
1216
  // package.json
1190
- var version = "0.0.585";
1217
+ var version = "0.0.586";
1218
+
1219
+ // lib/components/RunFrame/runner-store/use-runner-store.ts
1220
+ import { create } from "zustand";
1221
+ import { devtools } from "zustand/middleware";
1222
+ var useRunnerStore = create()(
1223
+ devtools(
1224
+ (set) => ({
1225
+ lastRunEvalVersion: void 0,
1226
+ setLastRunEvalVersion: (version2) => {
1227
+ set({ lastRunEvalVersion: version2 });
1228
+ }
1229
+ }),
1230
+ { name: "runframe-runner-store" }
1231
+ )
1232
+ );
1191
1233
 
1192
1234
  // lib/components/CircuitJsonPreview/CircuitJsonPreview.tsx
1193
1235
  import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
@@ -1232,6 +1274,7 @@ var CircuitJsonPreview = ({
1232
1274
  activeEffectName
1233
1275
  }) => {
1234
1276
  useStyles();
1277
+ const lastRunEvalVersion = useRunnerStore((s) => s.lastRunEvalVersion);
1235
1278
  const circuitJsonErrors = useMemo2(() => {
1236
1279
  if (!circuitJson) return null;
1237
1280
  return circuitJson.filter(
@@ -1544,6 +1587,8 @@ var CircuitJsonPreview = ({
1544
1587
  circuitJsonWarnings,
1545
1588
  errorMessage,
1546
1589
  errorStack,
1590
+ circuitJson,
1591
+ evalVersion: lastRunEvalVersion,
1547
1592
  autoroutingLog,
1548
1593
  onReportAutoroutingLog
1549
1594
  }
@@ -1574,8 +1619,8 @@ var debug = Debug("run-frame");
1574
1619
  var debug_default = debug;
1575
1620
 
1576
1621
  // lib/components/RunFrameWithApi/store.ts
1577
- import { create } from "zustand";
1578
- import { devtools } from "zustand/middleware";
1622
+ import { create as create2 } from "zustand";
1623
+ import { devtools as devtools2 } from "zustand/middleware";
1579
1624
 
1580
1625
  // lib/components/RunFrameWithApi/api-base.ts
1581
1626
  var API_BASE = window.TSCIRCUIT_FILESERVER_API_BASE_URL ?? "/api";
@@ -1614,8 +1659,8 @@ async function getInitialFilesApi() {
1614
1659
  }
1615
1660
  return fileMap;
1616
1661
  }
1617
- var useRunFrameStore = create()(
1618
- devtools(
1662
+ var useRunFrameStore = create2()(
1663
+ devtools2(
1619
1664
  (set, get) => ({
1620
1665
  fsMap: /* @__PURE__ */ new Map(),
1621
1666
  lastEventTime: (/* @__PURE__ */ new Date()).toISOString(),
@@ -2258,6 +2303,7 @@ export {
2258
2303
  linkify,
2259
2304
  BomTable,
2260
2305
  PcbViewerWithContainerHeight,
2306
+ useRunnerStore,
2261
2307
  CircuitJsonPreview,
2262
2308
  debug_default,
2263
2309
  API_BASE,
package/dist/preview.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  linkify,
9
9
  useOrderDialog,
10
10
  useOrderDialogCli
11
- } from "./chunk-B4J62OKU.js";
11
+ } from "./chunk-H6JVKVQZ.js";
12
12
  export {
13
13
  BomTable,
14
14
  CadViewer,
package/dist/runner.js CHANGED
@@ -35,8 +35,9 @@ import {
35
35
  toast,
36
36
  useOrderDialog,
37
37
  useOrderDialogCli,
38
- useRunFrameStore
39
- } from "./chunk-B4J62OKU.js";
38
+ useRunFrameStore,
39
+ useRunnerStore
40
+ } from "./chunk-H6JVKVQZ.js";
40
41
 
41
42
  // lib/components/RunFrame/RunFrame.tsx
42
43
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -96,21 +97,6 @@ var getChangesBetweenFsMaps = (fsMap1, fsMap2) => {
96
97
  return changes;
97
98
  };
98
99
 
99
- // lib/components/RunFrame/runner-store/use-runner-store.ts
100
- import { create } from "zustand";
101
- import { devtools } from "zustand/middleware";
102
- var useRunnerStore = create()(
103
- devtools(
104
- (set) => ({
105
- lastRunEvalVersion: void 0,
106
- setLastRunEvalVersion: (version) => {
107
- set({ lastRunEvalVersion: version });
108
- }
109
- }),
110
- { name: "runframe-runner-store" }
111
- )
112
- );
113
-
114
100
  // lib/components/RunFrame/useMutex.tsx
115
101
  import { useCallback, useRef } from "react";
116
102
  function useMutex() {
@@ -285,6 +271,7 @@ var RunFrame = (props) => {
285
271
  verbose: true
286
272
  });
287
273
  globalThis.runFrameWorker = worker;
274
+ setLastRunEvalVersion(evalVersion);
288
275
  props.onRenderStarted?.();
289
276
  const fsMapObj2 = fsMap instanceof Map ? Object.fromEntries(fsMap.entries()) : fsMap;
290
277
  const renderIds = /* @__PURE__ */ new Set();