Conversation
d247a21 to
032927f
Compare
cac27f1 to
43e31b1
Compare
adbd4ad to
75dd486
Compare
There was a problem hiding this comment.
Pull request overview
Adds /stats support across the TypeScript SDK stack so clients can fetch runtime statistics for all inputs and outputs (issue #1821).
Changes:
- Introduces Rust
StatsReportschema support (serde + JSON schema) and wires/statsinto the generated schema tooling. - Adds a
stats()method to core/web/node compositors and re-exports the related type(s). - Adds new TS stats type definitions and regenerates
api.generated.tsto include stats models.
Reviewed changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| ts/smelter/src/types/stats/input.ts | Adds TS input stats type definitions. |
| ts/smelter/src/types/stats/output.ts | Adds TS output stats type definitions. |
| ts/smelter/src/types/stats.ts | Adds a top-level TS StatsReport union model for inputs/outputs. |
| ts/smelter/src/api.generated.ts | Regenerates API types to include StatsReport and nested report types. |
| ts/smelter-core/src/api.ts | Adds ApiClient.stats() and new exported response type. |
| ts/smelter-core/src/live/compositor.ts | Exposes stats() on live core compositor. |
| ts/smelter-core/src/offline/compositor.ts | Exposes stats() on offline core compositor. |
| ts/smelter-core/src/index.ts | Re-exports stats-related type from core API module. |
| ts/smelter-web-wasm/src/compositor/compositor.ts | Exposes stats() in the web-wasm wrapper. |
| ts/smelter-web-client/src/smelter/live.ts | Exposes stats() in the web live wrapper. |
| ts/smelter-web-client/src/smelter/offline.ts | Exposes stats() in the web offline wrapper. |
| ts/smelter-web-client/src/api.ts | Re-exports stats-related type from core. |
| ts/smelter-node/src/live/compositor.ts | Exposes stats() in the node live wrapper. |
| ts/smelter-node/src/offline/compositor.ts | Exposes stats() in the node offline wrapper. |
| ts/smelter-node/src/api.ts | Re-exports stats-related type from core. |
| ts/examples/node-examples/src/audio.tsx | Demonstrates periodic stats polling/printing. |
| tools/src/bin/generate_from_types.rs | Adds StatsReport into schema-generation “type registry”. |
| smelter-core/src/stats/mod.rs | Derives Deserialize/JsonSchema for StatsReport. |
| smelter-core/src/stats/input_reports.rs | Derives Deserialize/JsonSchema for input report types. |
| smelter-core/src/stats/output_reports.rs | Derives Deserialize/JsonSchema for output report types. |
| smelter-core/Cargo.toml | Adds schemars dependency. |
| Cargo.lock | Locks schemars. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
b7ee921 to
1a41103
Compare
1a41103 to
184a3ac
Compare
There was a problem hiding this comment.
Pull request overview
Adds initial /stats support across the TS SDK layers by introducing stats report types, wiring schema generation, and exposing stats() methods on compositors.
Changes:
- Added new stats report type definitions in
@swmansion/smelterand includedStatsReportin generated API schema types. - Exposed
stats(): Promise<StatsReport>on smelter compositors (core/web-client/node/web-wasm) and added a coreGET /statsAPI client call. - Updated Rust stats report structs/enums to derive
JsonSchema(andDeserialize) and added theschemarsdependency.
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ts/smelter/src/types/stats/output.ts | Adds output stats report type definitions. |
| ts/smelter/src/types/stats/input.ts | Adds input stats report type definitions. |
| ts/smelter/src/types/stats.ts | Adds top-level StatsReport / union types for inputs/outputs. |
| ts/smelter/src/index.ts | Exports StatsReport from the public package entrypoint. |
| ts/smelter/src/api.generated.ts | Regenerates API schema types and includes stats types + ApiTypes union update. |
| ts/smelter-web-wasm/src/compositor/compositor.ts | Adds stats() method to the web-wasm compositor wrapper. |
| ts/smelter-web-client/src/smelter/offline.ts | Adds stats() method to offline web-client wrapper. |
| ts/smelter-web-client/src/smelter/live.ts | Adds stats() method to live web-client wrapper. |
| ts/smelter-web-client/src/api.ts | Re-exports StatsReport type from @swmansion/smelter. |
| ts/smelter-node/src/offline/compositor.ts | Adds stats() method to offline node wrapper. |
| ts/smelter-node/src/live/compositor.ts | Adds stats() method to live node wrapper. |
| ts/smelter-node/src/api.ts | Re-exports StatsReport type from @swmansion/smelter. |
| ts/smelter-core/src/offline/compositor.ts | Adds stats() method delegating to ApiClient. |
| ts/smelter-core/src/live/compositor.ts | Adds stats() method delegating to ApiClient. |
| ts/smelter-core/src/index.ts | Formatting-only export block change. |
| ts/smelter-core/src/api.ts | Adds GET /stats call returning StatsReport. |
| tools/src/bin/generate_from_types.rs | Adds StatsReport to schema generation enum. |
| smelter-core/src/stats/output_reports.rs | Adds JsonSchema/Deserialize derives for output stats types. |
| smelter-core/src/stats/mod.rs | Adds JsonSchema/Deserialize derives for StatsReport. |
| smelter-core/src/stats/input_reports.rs | Adds JsonSchema/Deserialize derives for input stats types. |
| smelter-core/Cargo.toml | Adds schemars dependency. |
| Cargo.lock | Locks schemars dependency. |
Comments suppressed due to low confidence (2)
ts/smelter-node/src/live/compositor.ts:190
stats()returnsStatsReportfrom@swmansion/smelter, butcoreSmelter.stats()returns the raw/statsJSON (snake_case). This method currently returns it unchanged, so the runtime shape will not match the camelCaseStatsReporttype. Either change the return type toApi.StatsReport(snake_case) or convert the payload before returning.
}
}
ts/smelter-web-client/src/smelter/offline.ts:120
stats()returnsStatsReportfrom@swmansion/smelter, butcoreSmelter.stats()returns raw server JSON withsnake_casekeys. This method currently forwards the response unchanged, so the runtime object will not match the declared camelCaseStatsReporttype. Either returnApi.StatsReport(snake_case) or map the response into the camelCase public type before returning.
});
}
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds initial /stats endpoint support across the TypeScript SDK stack (core + node/web clients) and updates Rust/TS schema generation so the stats types are included.
Changes:
- Introduces new stats type definitions in
@swmansion/smelterand addsStatsReportto generated API/schema types. - Adds
stats(): Promise<StatsReport>methods tosmelter-core,smelter-node, andsmelter-web-client. - Extends Rust stats report structs/enums with
JsonSchema/Deserializeand wires them into the schema generator.
Reviewed changes
Copilot reviewed 19 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| ts/smelter/src/types/stats/input.ts | Adds TS types for input stats (camelCase). |
| ts/smelter/src/types/stats/output.ts | Adds TS types for output stats (camelCase). |
| ts/smelter/src/types/stats.ts | Adds top-level StatsReport/union types for stats. |
| ts/smelter/src/index.ts | Re-exports StatsReport from the SDK entrypoint. |
| ts/smelter/src/api.generated.ts | Adds wire-format (snake_case) stats types + includes StatsReport in ApiTypes. |
| ts/smelter-core/src/api.ts | Adds ApiClient.stats() performing GET /stats. |
| ts/smelter-core/src/live/compositor.ts | Exposes stats() on live compositor wrapper. |
| ts/smelter-core/src/offline/compositor.ts | Exposes stats() on offline compositor wrapper. |
| ts/smelter-web-client/src/smelter/live.ts | Exposes stats() on web live client wrapper. |
| ts/smelter-web-client/src/smelter/offline.ts | Exposes stats() on web offline client wrapper. |
| ts/smelter-web-client/src/api.ts | Re-exports StatsReport from @swmansion/smelter. |
| ts/smelter-node/src/live/compositor.ts | Exposes stats() on node live client wrapper. |
| ts/smelter-node/src/offline/compositor.ts | Exposes stats() on node offline client wrapper. |
| ts/smelter-node/src/api.ts | Re-exports StatsReport from @swmansion/smelter. |
| tools/src/bin/generate_from_types.rs | Includes Rust StatsReport in ApiTypes schema generation. |
| smelter-core/src/stats/mod.rs | Adds Deserialize/JsonSchema derives to StatsReport. |
| smelter-core/src/stats/input_reports.rs | Adds Deserialize/JsonSchema derives to input stats reports. |
| smelter-core/src/stats/output_reports.rs | Adds Deserialize/JsonSchema derives to output stats reports. |
| smelter-core/Cargo.toml | Adds schemars dependency. |
| Cargo.lock | Locks schemars addition. |
| ts/smelter-web-wasm/src/compositor/compositor.ts | Formatting-only change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0ff3cd8 to
52fe41a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 23 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Closes #1821
For now it is just a basic method that returns stats for all inputs and outputs.