@tscircuit/eval 0.0.299 → 0.0.301
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.
- package/dist/blob-url.js +1 -1
- package/dist/eval/index.d.ts +184 -5
- package/dist/eval/index.js +19 -4
- package/dist/lib/index.d.ts +185 -5
- package/dist/lib/index.js +25 -4
- package/dist/webworker/entrypoint.js +363 -454
- package/dist/worker.d.ts +3 -1
- package/dist/worker.js +7 -1
- package/lib/runner/CircuitRunner.ts +12 -0
- package/lib/shared/types.ts +5 -1
- package/lib/worker.ts +7 -1
- package/package.json +11 -10
- package/tests/features/enable-debug.test.ts +33 -0
- package/webworker/entrypoint.ts +12 -0
- package/webworker/execution-context.ts +6 -0
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AnyCircuitElement } from 'circuit-json';
|
|
2
|
-
import { RootCircuitEventName, RootCircuit } from '@tscircuit/core';
|
|
2
|
+
import { RootCircuitEventName as RootCircuitEventName$1, RootCircuit } from '@tscircuit/core';
|
|
3
3
|
import { PlatformConfig } from '@tscircuit/props';
|
|
4
4
|
|
|
5
|
+
type RootCircuitEventName = RootCircuitEventName$1 | "debug:logOutput";
|
|
5
6
|
interface CircuitRunnerConfiguration {
|
|
6
7
|
snippetsApiBaseUrl: string;
|
|
7
8
|
cjsRegistryUrl: string;
|
|
@@ -41,6 +42,7 @@ interface CircuitRunnerApi {
|
|
|
41
42
|
getCircuitJson: () => Promise<AnyCircuitElement[]>;
|
|
42
43
|
setSnippetsApiBaseUrl: (baseUrl: string) => Promise<void>;
|
|
43
44
|
setPlatformConfig: (platform: PlatformConfig) => Promise<void>;
|
|
45
|
+
enableDebug: (namespace: string) => Promise<void>;
|
|
44
46
|
on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void;
|
|
45
47
|
clearEventListeners: () => void;
|
|
46
48
|
kill: () => Promise<void>;
|
|
@@ -57,6 +59,7 @@ type CircuitWebWorker = {
|
|
|
57
59
|
getCircuitJson: () => Promise<AnyCircuitElement[]>;
|
|
58
60
|
on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void;
|
|
59
61
|
clearEventListeners: () => void;
|
|
62
|
+
enableDebug: (namespace: string) => Promise<void>;
|
|
60
63
|
version: () => Promise<string>;
|
|
61
64
|
kill: () => Promise<void>;
|
|
62
65
|
};
|
|
@@ -70,12 +73,14 @@ interface ExecutionContext extends WebWorkerConfiguration {
|
|
|
70
73
|
declare function createExecutionContext(webWorkerConfiguration: WebWorkerConfiguration, opts?: {
|
|
71
74
|
name?: string;
|
|
72
75
|
platform?: PlatformConfig;
|
|
76
|
+
debugNamespace?: string;
|
|
73
77
|
}): ExecutionContext;
|
|
74
78
|
|
|
75
79
|
declare class CircuitRunner implements CircuitRunnerApi {
|
|
76
80
|
_executionContext: ReturnType<typeof createExecutionContext> | null;
|
|
77
81
|
_circuitRunnerConfiguration: CircuitRunnerConfiguration;
|
|
78
82
|
_eventListeners: Record<string, ((...args: any[]) => void)[]>;
|
|
83
|
+
_debugNamespace: string | undefined;
|
|
79
84
|
constructor(configuration?: Partial<CircuitRunnerConfiguration>);
|
|
80
85
|
version(): Promise<string>;
|
|
81
86
|
executeWithFsMap(ogOpts: {
|
|
@@ -99,6 +104,7 @@ declare class CircuitRunner implements CircuitRunnerApi {
|
|
|
99
104
|
kill(): Promise<void>;
|
|
100
105
|
setSnippetsApiBaseUrl(baseUrl: string): Promise<void>;
|
|
101
106
|
setPlatformConfig(platform: PlatformConfig): Promise<void>;
|
|
107
|
+
enableDebug(namespace: string): Promise<void>;
|
|
102
108
|
private _bindEventListeners;
|
|
103
109
|
}
|
|
104
110
|
|
|
@@ -119,8 +125,8 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
119
125
|
source_port_id: string;
|
|
120
126
|
subcircuit_id?: string | undefined;
|
|
121
127
|
port_hints?: string[] | undefined;
|
|
122
|
-
pin_number?: number | undefined;
|
|
123
128
|
subcircuit_connectivity_map_key?: string | undefined;
|
|
129
|
+
pin_number?: number | undefined;
|
|
124
130
|
} | {
|
|
125
131
|
type: "source_component";
|
|
126
132
|
name: string;
|
|
@@ -294,6 +300,18 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
294
300
|
display_value?: string | undefined;
|
|
295
301
|
are_pins_interchangeable?: boolean | undefined;
|
|
296
302
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
303
|
+
} | {
|
|
304
|
+
type: "source_component";
|
|
305
|
+
name: string;
|
|
306
|
+
source_component_id: string;
|
|
307
|
+
ftype: "simple_pinout";
|
|
308
|
+
subcircuit_id?: string | undefined;
|
|
309
|
+
source_group_id?: string | undefined;
|
|
310
|
+
manufacturer_part_number?: string | undefined;
|
|
311
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
312
|
+
display_value?: string | undefined;
|
|
313
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
314
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
297
315
|
} | {
|
|
298
316
|
type: "source_component";
|
|
299
317
|
name: string;
|
|
@@ -448,6 +466,7 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
448
466
|
is_ground?: boolean | undefined;
|
|
449
467
|
is_digital_signal?: boolean | undefined;
|
|
450
468
|
is_analog_signal?: boolean | undefined;
|
|
469
|
+
is_positive_voltage_source?: boolean | undefined;
|
|
451
470
|
} | {
|
|
452
471
|
type: "source_group";
|
|
453
472
|
source_group_id: string;
|
|
@@ -578,6 +597,18 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
578
597
|
display_value?: string | undefined;
|
|
579
598
|
are_pins_interchangeable?: boolean | undefined;
|
|
580
599
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
600
|
+
} | {
|
|
601
|
+
type: "source_component";
|
|
602
|
+
name: string;
|
|
603
|
+
source_component_id: string;
|
|
604
|
+
ftype: "simple_pinout";
|
|
605
|
+
subcircuit_id?: string | undefined;
|
|
606
|
+
source_group_id?: string | undefined;
|
|
607
|
+
manufacturer_part_number?: string | undefined;
|
|
608
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
609
|
+
display_value?: string | undefined;
|
|
610
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
611
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
581
612
|
} | {
|
|
582
613
|
type: "source_component";
|
|
583
614
|
name: string;
|
|
@@ -681,6 +712,13 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
681
712
|
source_net_id: string;
|
|
682
713
|
source_pcb_ground_plane_id: string;
|
|
683
714
|
subcircuit_id?: string | undefined;
|
|
715
|
+
} | {
|
|
716
|
+
type: "source_manually_placed_via";
|
|
717
|
+
source_group_id: string;
|
|
718
|
+
source_net_id: string;
|
|
719
|
+
source_manually_placed_via_id: string;
|
|
720
|
+
subcircuit_id?: string | undefined;
|
|
721
|
+
source_trace_id?: string | undefined;
|
|
684
722
|
} | {
|
|
685
723
|
type: "source_project_metadata";
|
|
686
724
|
name?: string | undefined;
|
|
@@ -1385,6 +1423,57 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1385
1423
|
spoke_outer_diameter: number;
|
|
1386
1424
|
subcircuit_id?: string | undefined;
|
|
1387
1425
|
pcb_plated_hole_id?: string | undefined;
|
|
1426
|
+
} | {
|
|
1427
|
+
type: "pcb_copper_pour";
|
|
1428
|
+
width: number;
|
|
1429
|
+
height: number;
|
|
1430
|
+
center: {
|
|
1431
|
+
x: number;
|
|
1432
|
+
y: number;
|
|
1433
|
+
};
|
|
1434
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1435
|
+
shape: "rect";
|
|
1436
|
+
pcb_copper_pour_id: string;
|
|
1437
|
+
rotation?: number | undefined;
|
|
1438
|
+
subcircuit_id?: string | undefined;
|
|
1439
|
+
pcb_group_id?: string | undefined;
|
|
1440
|
+
source_net_id?: string | undefined;
|
|
1441
|
+
} | {
|
|
1442
|
+
type: "pcb_copper_pour";
|
|
1443
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1444
|
+
shape: "brep";
|
|
1445
|
+
pcb_copper_pour_id: string;
|
|
1446
|
+
brep_shape: {
|
|
1447
|
+
outer_ring: {
|
|
1448
|
+
vertices: {
|
|
1449
|
+
x: number;
|
|
1450
|
+
y: number;
|
|
1451
|
+
bulge?: number | undefined;
|
|
1452
|
+
}[];
|
|
1453
|
+
};
|
|
1454
|
+
inner_rings: {
|
|
1455
|
+
vertices: {
|
|
1456
|
+
x: number;
|
|
1457
|
+
y: number;
|
|
1458
|
+
bulge?: number | undefined;
|
|
1459
|
+
}[];
|
|
1460
|
+
}[];
|
|
1461
|
+
};
|
|
1462
|
+
subcircuit_id?: string | undefined;
|
|
1463
|
+
pcb_group_id?: string | undefined;
|
|
1464
|
+
source_net_id?: string | undefined;
|
|
1465
|
+
} | {
|
|
1466
|
+
type: "pcb_copper_pour";
|
|
1467
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1468
|
+
shape: "polygon";
|
|
1469
|
+
points: {
|
|
1470
|
+
x: number;
|
|
1471
|
+
y: number;
|
|
1472
|
+
}[];
|
|
1473
|
+
pcb_copper_pour_id: string;
|
|
1474
|
+
subcircuit_id?: string | undefined;
|
|
1475
|
+
pcb_group_id?: string | undefined;
|
|
1476
|
+
source_net_id?: string | undefined;
|
|
1388
1477
|
} | {
|
|
1389
1478
|
x: number;
|
|
1390
1479
|
y: number;
|
|
@@ -1485,7 +1574,6 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1485
1574
|
has_output_arrow?: boolean | undefined;
|
|
1486
1575
|
} | {
|
|
1487
1576
|
type: "schematic_trace";
|
|
1488
|
-
source_trace_id: string;
|
|
1489
1577
|
schematic_trace_id: string;
|
|
1490
1578
|
junctions: {
|
|
1491
1579
|
x: number;
|
|
@@ -1505,6 +1593,8 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1505
1593
|
to_schematic_port_id?: string | undefined;
|
|
1506
1594
|
}[];
|
|
1507
1595
|
subcircuit_id?: string | undefined;
|
|
1596
|
+
source_trace_id?: string | undefined;
|
|
1597
|
+
subcircuit_connectivity_map_key?: string | undefined;
|
|
1508
1598
|
} | {
|
|
1509
1599
|
type: "schematic_path";
|
|
1510
1600
|
points: {
|
|
@@ -1676,6 +1766,9 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1676
1766
|
model_obj_url?: string | undefined;
|
|
1677
1767
|
model_stl_url?: string | undefined;
|
|
1678
1768
|
model_3mf_url?: string | undefined;
|
|
1769
|
+
model_gltf_url?: string | undefined;
|
|
1770
|
+
model_glb_url?: string | undefined;
|
|
1771
|
+
model_step_url?: string | undefined;
|
|
1679
1772
|
model_jscad?: any;
|
|
1680
1773
|
} | {
|
|
1681
1774
|
type: "simulation_voltage_source";
|
|
@@ -1722,8 +1815,8 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
1722
1815
|
source_port_id: string;
|
|
1723
1816
|
subcircuit_id?: string | undefined;
|
|
1724
1817
|
port_hints?: string[] | undefined;
|
|
1725
|
-
pin_number?: number | undefined;
|
|
1726
1818
|
subcircuit_connectivity_map_key?: string | undefined;
|
|
1819
|
+
pin_number?: number | undefined;
|
|
1727
1820
|
} | {
|
|
1728
1821
|
type: "source_component";
|
|
1729
1822
|
name: string;
|
|
@@ -1897,6 +1990,18 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
1897
1990
|
display_value?: string | undefined;
|
|
1898
1991
|
are_pins_interchangeable?: boolean | undefined;
|
|
1899
1992
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
1993
|
+
} | {
|
|
1994
|
+
type: "source_component";
|
|
1995
|
+
name: string;
|
|
1996
|
+
source_component_id: string;
|
|
1997
|
+
ftype: "simple_pinout";
|
|
1998
|
+
subcircuit_id?: string | undefined;
|
|
1999
|
+
source_group_id?: string | undefined;
|
|
2000
|
+
manufacturer_part_number?: string | undefined;
|
|
2001
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
2002
|
+
display_value?: string | undefined;
|
|
2003
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
2004
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
1900
2005
|
} | {
|
|
1901
2006
|
type: "source_component";
|
|
1902
2007
|
name: string;
|
|
@@ -2051,6 +2156,7 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2051
2156
|
is_ground?: boolean | undefined;
|
|
2052
2157
|
is_digital_signal?: boolean | undefined;
|
|
2053
2158
|
is_analog_signal?: boolean | undefined;
|
|
2159
|
+
is_positive_voltage_source?: boolean | undefined;
|
|
2054
2160
|
} | {
|
|
2055
2161
|
type: "source_group";
|
|
2056
2162
|
source_group_id: string;
|
|
@@ -2181,6 +2287,18 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2181
2287
|
display_value?: string | undefined;
|
|
2182
2288
|
are_pins_interchangeable?: boolean | undefined;
|
|
2183
2289
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
2290
|
+
} | {
|
|
2291
|
+
type: "source_component";
|
|
2292
|
+
name: string;
|
|
2293
|
+
source_component_id: string;
|
|
2294
|
+
ftype: "simple_pinout";
|
|
2295
|
+
subcircuit_id?: string | undefined;
|
|
2296
|
+
source_group_id?: string | undefined;
|
|
2297
|
+
manufacturer_part_number?: string | undefined;
|
|
2298
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
2299
|
+
display_value?: string | undefined;
|
|
2300
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
2301
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
2184
2302
|
} | {
|
|
2185
2303
|
type: "source_component";
|
|
2186
2304
|
name: string;
|
|
@@ -2284,6 +2402,13 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2284
2402
|
source_net_id: string;
|
|
2285
2403
|
source_pcb_ground_plane_id: string;
|
|
2286
2404
|
subcircuit_id?: string | undefined;
|
|
2405
|
+
} | {
|
|
2406
|
+
type: "source_manually_placed_via";
|
|
2407
|
+
source_group_id: string;
|
|
2408
|
+
source_net_id: string;
|
|
2409
|
+
source_manually_placed_via_id: string;
|
|
2410
|
+
subcircuit_id?: string | undefined;
|
|
2411
|
+
source_trace_id?: string | undefined;
|
|
2287
2412
|
} | {
|
|
2288
2413
|
type: "source_project_metadata";
|
|
2289
2414
|
name?: string | undefined;
|
|
@@ -2988,6 +3113,57 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2988
3113
|
spoke_outer_diameter: number;
|
|
2989
3114
|
subcircuit_id?: string | undefined;
|
|
2990
3115
|
pcb_plated_hole_id?: string | undefined;
|
|
3116
|
+
} | {
|
|
3117
|
+
type: "pcb_copper_pour";
|
|
3118
|
+
width: number;
|
|
3119
|
+
height: number;
|
|
3120
|
+
center: {
|
|
3121
|
+
x: number;
|
|
3122
|
+
y: number;
|
|
3123
|
+
};
|
|
3124
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3125
|
+
shape: "rect";
|
|
3126
|
+
pcb_copper_pour_id: string;
|
|
3127
|
+
rotation?: number | undefined;
|
|
3128
|
+
subcircuit_id?: string | undefined;
|
|
3129
|
+
pcb_group_id?: string | undefined;
|
|
3130
|
+
source_net_id?: string | undefined;
|
|
3131
|
+
} | {
|
|
3132
|
+
type: "pcb_copper_pour";
|
|
3133
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3134
|
+
shape: "brep";
|
|
3135
|
+
pcb_copper_pour_id: string;
|
|
3136
|
+
brep_shape: {
|
|
3137
|
+
outer_ring: {
|
|
3138
|
+
vertices: {
|
|
3139
|
+
x: number;
|
|
3140
|
+
y: number;
|
|
3141
|
+
bulge?: number | undefined;
|
|
3142
|
+
}[];
|
|
3143
|
+
};
|
|
3144
|
+
inner_rings: {
|
|
3145
|
+
vertices: {
|
|
3146
|
+
x: number;
|
|
3147
|
+
y: number;
|
|
3148
|
+
bulge?: number | undefined;
|
|
3149
|
+
}[];
|
|
3150
|
+
}[];
|
|
3151
|
+
};
|
|
3152
|
+
subcircuit_id?: string | undefined;
|
|
3153
|
+
pcb_group_id?: string | undefined;
|
|
3154
|
+
source_net_id?: string | undefined;
|
|
3155
|
+
} | {
|
|
3156
|
+
type: "pcb_copper_pour";
|
|
3157
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3158
|
+
shape: "polygon";
|
|
3159
|
+
points: {
|
|
3160
|
+
x: number;
|
|
3161
|
+
y: number;
|
|
3162
|
+
}[];
|
|
3163
|
+
pcb_copper_pour_id: string;
|
|
3164
|
+
subcircuit_id?: string | undefined;
|
|
3165
|
+
pcb_group_id?: string | undefined;
|
|
3166
|
+
source_net_id?: string | undefined;
|
|
2991
3167
|
} | {
|
|
2992
3168
|
x: number;
|
|
2993
3169
|
y: number;
|
|
@@ -3088,7 +3264,6 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
3088
3264
|
has_output_arrow?: boolean | undefined;
|
|
3089
3265
|
} | {
|
|
3090
3266
|
type: "schematic_trace";
|
|
3091
|
-
source_trace_id: string;
|
|
3092
3267
|
schematic_trace_id: string;
|
|
3093
3268
|
junctions: {
|
|
3094
3269
|
x: number;
|
|
@@ -3108,6 +3283,8 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
3108
3283
|
to_schematic_port_id?: string | undefined;
|
|
3109
3284
|
}[];
|
|
3110
3285
|
subcircuit_id?: string | undefined;
|
|
3286
|
+
source_trace_id?: string | undefined;
|
|
3287
|
+
subcircuit_connectivity_map_key?: string | undefined;
|
|
3111
3288
|
} | {
|
|
3112
3289
|
type: "schematic_path";
|
|
3113
3290
|
points: {
|
|
@@ -3279,6 +3456,9 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
3279
3456
|
model_obj_url?: string | undefined;
|
|
3280
3457
|
model_stl_url?: string | undefined;
|
|
3281
3458
|
model_3mf_url?: string | undefined;
|
|
3459
|
+
model_gltf_url?: string | undefined;
|
|
3460
|
+
model_glb_url?: string | undefined;
|
|
3461
|
+
model_step_url?: string | undefined;
|
|
3282
3462
|
model_jscad?: any;
|
|
3283
3463
|
} | {
|
|
3284
3464
|
type: "simulation_voltage_source";
|