@tscircuit/cli 0.1.346 → 0.1.347

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.
Files changed (2) hide show
  1. package/dist/main.js +27 -9
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -72193,7 +72193,7 @@ var getGlobalDepsInstallCommand = (packageManager, deps) => {
72193
72193
  import { execSync as execSync2 } from "node:child_process";
72194
72194
  var import_semver2 = __toESM2(require_semver2(), 1);
72195
72195
  // package.json
72196
- var version = "0.1.345";
72196
+ var version = "0.1.346";
72197
72197
  var package_default = {
72198
72198
  name: "@tscircuit/cli",
72199
72199
  version,
@@ -72203,7 +72203,7 @@ var package_default = {
72203
72203
  "@biomejs/biome": "^1.9.4",
72204
72204
  "@tscircuit/circuit-json-util": "0.0.67",
72205
72205
  "@tscircuit/fake-snippets": "^0.0.110",
72206
- "@tscircuit/file-server": "^0.0.30",
72206
+ "@tscircuit/file-server": "^0.0.32",
72207
72207
  "@tscircuit/math-utils": "0.0.21",
72208
72208
  "@tscircuit/props": "^0.0.356",
72209
72209
  "@tscircuit/runframe": "^0.0.1116",
@@ -73349,11 +73349,17 @@ var initializer = combine(databaseSchema.parse({}), (set, get) => ({
73349
73349
  }));
73350
73350
  return get().events[get().events.length - 1];
73351
73351
  },
73352
- listEvents: (since) => {
73352
+ listEvents: (params2) => {
73353
73353
  const state = get();
73354
- if (!since)
73355
- return state.events;
73356
- return state.events.filter((e) => e.created_at > since);
73354
+ const { since, event_type } = params2 ?? {};
73355
+ let events = state.events;
73356
+ if (since) {
73357
+ events = events.filter((e) => e.created_at > since);
73358
+ }
73359
+ if (event_type) {
73360
+ events = events.filter((e) => e.event_type === event_type);
73361
+ }
73362
+ return events;
73357
73363
  },
73358
73364
  resetEvents: () => {
73359
73365
  set((state) => ({
@@ -73636,7 +73642,8 @@ var create_default2 = withRouteSpec({
73636
73642
  var list_default3 = withRouteSpec({
73637
73643
  methods: ["GET"],
73638
73644
  queryParams: z8.object({
73639
- since: z8.string().optional()
73645
+ since: z8.string().optional(),
73646
+ event_type: z8.string().optional()
73640
73647
  }),
73641
73648
  jsonResponse: z8.object({
73642
73649
  event_list: z8.array(z8.object({
@@ -73647,8 +73654,8 @@ var list_default3 = withRouteSpec({
73647
73654
  }).passthrough())
73648
73655
  })
73649
73656
  })((req, ctx) => {
73650
- const { since } = req.query;
73651
- return ctx.json({ event_list: ctx.db.listEvents(since) });
73657
+ const { since, event_type } = req.query;
73658
+ return ctx.json({ event_list: ctx.db.listEvents({ since, event_type }) });
73652
73659
  });
73653
73660
  var reset_default = withRouteSpec({
73654
73661
  methods: ["POST"],
@@ -73992,6 +73999,7 @@ This is a simple file server API, it has the following API:
73992
73999
  /files/upsert - Upsert a file
73993
74000
 
73994
74001
  /events/list?since=... - List events since a given timestamp
74002
+ /events/list?event_type=... - List events filtered by event type
73995
74003
  </pre>
73996
74004
 
73997
74005
 
@@ -77024,6 +77032,9 @@ class DevServer {
77024
77032
  debug2(`File renamed from ${oldRelativePath} to ${newRelativePath}`);
77025
77033
  }
77026
77034
  async upsertInitialFiles() {
77035
+ await this.fsKy.post("api/events/reset", {
77036
+ json: {}
77037
+ });
77027
77038
  const filePaths = getPackageFilePaths(this.projectDir, this.ignoredFiles);
77028
77039
  for (const filePath of filePaths) {
77029
77040
  const relativeFilePath = path18.relative(this.projectDir, filePath);
@@ -77036,6 +77047,13 @@ class DevServer {
77036
77047
  }
77037
77048
  });
77038
77049
  }
77050
+ await this.fsKy.post("api/events/create", {
77051
+ json: {
77052
+ event_type: "INITIAL_FILES_UPLOADED",
77053
+ file_count: filePaths.length
77054
+ },
77055
+ throwHttpErrors: false
77056
+ });
77039
77057
  }
77040
77058
  async saveSnippet() {
77041
77059
  const postEvent = async (event, message) => this.fsKy.post("api/events/create", {
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@tscircuit/cli",
3
- "version": "0.1.346",
3
+ "version": "0.1.347",
4
4
  "main": "dist/main.js",
5
5
  "devDependencies": {
6
6
  "@babel/standalone": "^7.26.9",
7
7
  "@biomejs/biome": "^1.9.4",
8
8
  "@tscircuit/circuit-json-util": "0.0.67",
9
9
  "@tscircuit/fake-snippets": "^0.0.110",
10
- "@tscircuit/file-server": "^0.0.30",
10
+ "@tscircuit/file-server": "^0.0.32",
11
11
  "@tscircuit/math-utils": "0.0.21",
12
12
  "@tscircuit/props": "^0.0.356",
13
13
  "@tscircuit/runframe": "^0.0.1116",