@layer_ai/sdk 1.0.48 → 1.0.51

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.
@@ -1073,6 +1073,15 @@ export interface ExecuteWorkflowRequest {
1073
1073
  /** Deliver this run's terminal events to a URL instead of polling for them. Only the run's own outcome is delivered — the generations it performs internally are not yours to poll and raise no events of their own. See the Webhooks section of this document for the payload, headers and retry behaviour. */
1074
1074
  webhook?: WebhookInput | null;
1075
1075
  }
1076
+ /** What an engine needs beyond the image to build a resource from a file. Each kind is null when absent. */
1077
+ export interface FileMetadataView {
1078
+ /** Grid placement, for a game tile sprite. */
1079
+ tile?: TileMetadataView | null;
1080
+ /** 9-slice insets, for a UI element such as a button, frame, or panel. */
1081
+ nine_slice?: NineSliceMetadataView | null;
1082
+ /** Frame grid and animations, for a sprite sheet. */
1083
+ sprite_sheet?: SpriteSheetMetadataView | null;
1084
+ }
1076
1085
  export interface FileScore {
1077
1086
  /** The rule that produced this verdict. */
1078
1087
  rule_id: string;
@@ -1161,6 +1170,8 @@ export interface ForgeRunAsset {
1161
1170
  duration_seconds?: number | null;
1162
1171
  /** File size in bytes. */
1163
1172
  file_size_bytes?: number | null;
1173
+ /** What an engine needs beyond the file to build a resource from it. Null when the file has none. */
1174
+ metadata?: FileMetadataView | null;
1164
1175
  }
1165
1176
  export interface ForgeVideoEffectInput {
1166
1177
  /** Video effect type. See model capabilities for supported effects per model. */
@@ -1183,7 +1194,7 @@ export interface GetForgeRunOutput {
1183
1194
  actual_price_creative_units?: number | null;
1184
1195
  /** Error message. Present only on FAILED. */
1185
1196
  error?: string | null;
1186
- /** Machine-readable error code. Present only on FAILED. Balance-related values: `INSUFFICIENT_BALANCE` (the workspace ran out of Creative Units — top up and resubmit) and `BALANCE_UNAVAILABLE` (the balance could not be verified — retry later). */
1197
+ /** Machine-readable error code. Present only on FAILED. Balance-related values: `INSUFFICIENT_BALANCE` (the workspace ran out of Creative Units — top up and resubmit), `BALANCE_UNAVAILABLE` (the balance could not be verified, retry later) and `USAGE_LIMIT_EXCEEDED` (the member is past their usage limit: ask a workspace admin for more, or wait for it to reset). */
1187
1198
  error_code?: string | null;
1188
1199
  }
1189
1200
  export interface GetInferenceRunV2Output {
@@ -1201,7 +1212,7 @@ export interface GetInferenceRunV2Output {
1201
1212
  actual_price_creative_units?: number | null;
1202
1213
  /** Error message. Present only on FAILED. */
1203
1214
  error?: string | null;
1204
- /** Machine-readable error code. Present only on FAILED. Balance-related values: `INSUFFICIENT_BALANCE` (the workspace ran out of Creative Units — top up and resubmit) and `BALANCE_UNAVAILABLE` (the balance could not be verified — retry later). */
1215
+ /** Machine-readable error code. Present only on FAILED. Balance-related values: `INSUFFICIENT_BALANCE` (the workspace ran out of Creative Units — top up and resubmit), `BALANCE_UNAVAILABLE` (the balance could not be verified, retry later) and `USAGE_LIMIT_EXCEEDED` (the member is past their usage limit: ask a workspace admin for more, or wait for it to reset). */
1205
1216
  error_code?: string | null;
1206
1217
  /** Base model the run used, resolved or auto-picked. */
1207
1218
  base_model_id?: string | null;
@@ -1302,7 +1313,7 @@ export interface GetWorkflowRunOutput {
1302
1313
  outputs?: Array<WorkflowRunAsset> | null;
1303
1314
  /** Error message. Present only on FAILURE. */
1304
1315
  error?: string | null;
1305
- /** Machine-readable error code. Present only on FAILURE. Balance-related values: `BlueprintInsufficientBalanceError` (the workspace ran out of Creative Units — top up and resubmit) and `BlueprintBalanceUnavailableError` (the balance could not be verified — retry later). */
1316
+ /** Machine-readable error code. Present only on FAILURE. Balance-related values: `BlueprintInsufficientBalanceError` (the workspace ran out of Creative Units — top up and resubmit), `BlueprintBalanceUnavailableError` (the balance could not be verified, retry later) and `BlueprintUsageLimitExceededError` (the member who started the run is past their usage limit: ask a workspace admin for more, or wait for it to reset). */
1306
1317
  error_code?: string | null;
1307
1318
  /** The callback attached to this run and how its delivery has gone. Null when the run was submitted without one. */
1308
1319
  webhook?: WebhookStatusView | null;
@@ -1544,6 +1555,25 @@ export interface MusicSection {
1544
1555
  negative_styles?: Array<string>;
1545
1556
  lines?: Array<string>;
1546
1557
  }
1558
+ /**
1559
+ * The insets a 9-slice draws a UI element by, in the image's own pixels in from each edge.
1560
+ *
1561
+ * The corners are drawn at their own size, the edges stretch along their length, and the centre
1562
+ * stretches both ways.
1563
+ */
1564
+ export interface NineSliceMetadataView {
1565
+ /** Pixels in from the left edge. */
1566
+ left: number;
1567
+ /** Pixels in from the top edge. */
1568
+ top: number;
1569
+ /** Pixels in from the right edge. */
1570
+ right: number;
1571
+ /** Pixels in from the bottom edge. */
1572
+ bottom: number;
1573
+ /** DETECTED when measured off the pixels, USER when a person set the insets. */
1574
+ source: NineSliceSource;
1575
+ }
1576
+ export type NineSliceSource = "DETECTED" | "USER";
1547
1577
  /**
1548
1578
  * Inference parameters after model-specific normalization.
1549
1579
  *
@@ -1860,6 +1890,8 @@ export interface SessionEventObject {
1860
1890
  width?: number | null;
1861
1891
  /** Height in pixels, for an image or video file. */
1862
1892
  height?: number | null;
1893
+ /** What an engine needs beyond the file to build a resource from it, for a file. Null when it has none. */
1894
+ metadata?: FileMetadataView | null;
1863
1895
  }
1864
1896
  /** A file or asset in the session, as it stands now: what a `SessionEvent` carries. */
1865
1897
  export interface SessionObject {
@@ -1879,6 +1911,8 @@ export interface SessionObject {
1879
1911
  width?: number | null;
1880
1912
  /** Height in pixels, for an image or video file. */
1881
1913
  height?: number | null;
1914
+ /** What an engine needs beyond the file to build a resource from it, for a file. Null when it has none. */
1915
+ metadata?: FileMetadataView | null;
1882
1916
  /** The object's id, the same one its `SessionEvent`s carry. For a file this is its file_id. */
1883
1917
  object_id: string;
1884
1918
  }
@@ -1899,12 +1933,64 @@ export interface SetUsageLimitBody {
1899
1933
  cu_limit: number;
1900
1934
  /** Reset period for the cap (e.g. DAILY, MONTHLY). */
1901
1935
  period: UsageLimitPeriod;
1936
+ /** WARN tells members they are past the cap; BLOCK also stops anything that charges Creative Units. */
1937
+ mode?: UsageLimitMode;
1938
+ /** Percent of the cap at which members are warned. */
1939
+ warn_threshold_pct?: number;
1902
1940
  }
1903
1941
  export interface SkippedFile {
1904
1942
  file_id: string;
1905
1943
  /** Why this file_id was not added: not_found (no such file), foreign_workspace (belongs to another workspace), already_member (already in the set), or duplicate_in_request (listed more than once in this call). */
1906
1944
  reason: "not_found" | "foreign_workspace" | "already_member" | "duplicate_in_request";
1907
1945
  }
1946
+ export interface SpriteSheetAnimationView {
1947
+ /** The animation's name. */
1948
+ name: string;
1949
+ /** Frame indexes (`frames[].index`), in play order. */
1950
+ frames: Array<number>;
1951
+ /** Frames per second. */
1952
+ fps: number;
1953
+ /** Whether the animation restarts after its last frame. */
1954
+ loop: boolean;
1955
+ }
1956
+ /** One frame's rect on the sheet, in the sheet's own pixels from its top-left corner. */
1957
+ export interface SpriteSheetFrameView {
1958
+ /** The frame's cell in reading order over the whole grid (left to right, then top to bottom). Cells that hold no frame are left out, so indexes can skip. */
1959
+ index: number;
1960
+ /** The frame's left edge on the sheet, in pixels. */
1961
+ x: number;
1962
+ /** The frame's top edge on the sheet, in pixels. */
1963
+ y: number;
1964
+ /** The frame's width in pixels. */
1965
+ w: number;
1966
+ /** The frame's height in pixels. */
1967
+ h: number;
1968
+ /** The point the frame is placed by, in pixels from the frame's top-left corner. Null when the frames were registered by centring them in their cells. */
1969
+ anchor?: TilePointView | null;
1970
+ }
1971
+ /**
1972
+ * The frame grid a sprite sheet was packed on, in the sheet's own pixels from its top-left corner.
1973
+ *
1974
+ * Cells start `margin` pixels in from the sheet's edges with `spacing` pixels between them.
1975
+ */
1976
+ export interface SpriteSheetMetadataView {
1977
+ /** Cells across. */
1978
+ columns: number;
1979
+ /** Cells down. */
1980
+ rows: number;
1981
+ /** Width of one cell in pixels. */
1982
+ cell_width: number;
1983
+ /** Height of one cell in pixels. */
1984
+ cell_height: number;
1985
+ /** Pixels between the sheet's edges and the outer cells. */
1986
+ margin: number;
1987
+ /** Pixels between neighbouring cells. */
1988
+ spacing: number;
1989
+ /** The frames, in play order: left to right, then top to bottom, unless the list orders them otherwise. */
1990
+ frames: Array<SpriteSheetFrameView>;
1991
+ /** Named animations over the frames. When empty, play the sheet as one animation named `default` over every frame in `frames` order, at 12 fps, looping. */
1992
+ animations: Array<SpriteSheetAnimationView>;
1993
+ }
1908
1994
  export interface StartTrainingRequest {
1909
1995
  /** The reference set (Style) to train a LoRA for. */
1910
1996
  reference_set_id: string;
@@ -1970,6 +2056,35 @@ export interface TileGrid {
1970
2056
  }
1971
2057
  /** The side the key light comes from, seen from the camera. */
1972
2058
  export type TileLightSide = "left" | "right";
2059
+ /** Where a game tile's sprite sits on its grid, in the sprite's own pixels from its top-left corner. */
2060
+ export interface TileMetadataView {
2061
+ /** The outline of one grid cell seen from straight above. */
2062
+ shape: TileShape;
2063
+ /** How the cell is turned to the camera: DIAMOND or ALIGNED for a square, POINTY_TOP or FLAT_TOP for a hexagon. */
2064
+ orientation: TileOrientation;
2065
+ /** Camera tilt in degrees above the ground plane; 90 is straight down. */
2066
+ elevation: number;
2067
+ /** Quarter turn of the camera around the tile, in degrees clockwise seen from above: 0, 90, 180, or 270. A hexagon is only drawn facing 0. */
2068
+ facing: number;
2069
+ /** Cells the footprint covers across (the base's right-hand edge) at facing 0. */
2070
+ footprint_width: number;
2071
+ /** Cells the footprint covers deep (the base's left-hand edge) at facing 0. */
2072
+ footprint_depth: number;
2073
+ /** Wall height in cell sides: 0 is a flat ground tile, 1 a cube on a square. */
2074
+ height: number;
2075
+ /** Width in pixels of one cell's base outline in the sprite. */
2076
+ tile_width: number;
2077
+ /** Height in pixels of one cell's base outline in the sprite. */
2078
+ tile_height: number;
2079
+ /** The point the tile is placed by: the bottom centre of the cell it stands on (the front cell of a footprint wider than one). */
2080
+ anchor: TilePointView;
2081
+ /** The centre of the anchor's cell. Godot and Unity pin a tile here rather than at the anchor. */
2082
+ cell_center: TilePointView;
2083
+ /** The footprint's whole base outline, clockwise on screen from the anchor's vertex or edge. */
2084
+ base_outline: Array<TilePointView>;
2085
+ /** What the tile shows. Every facing of one subject shares it, so a tileset can group them. */
2086
+ subject_id?: string | null;
2087
+ }
1973
2088
  /**
1974
2089
  * How a cell's outline is turned to the camera.
1975
2090
  *
@@ -1978,6 +2093,12 @@ export type TileLightSide = "left" | "right";
1978
2093
  * vertex (``POINTY_TOP``) or an edge (``FLAT_TOP``) at the top.
1979
2094
  */
1980
2095
  export type TileOrientation = "DIAMOND" | "ALIGNED" | "POINTY_TOP" | "FLAT_TOP";
2096
+ export interface TilePointView {
2097
+ /** Pixels right of the sprite's left edge. */
2098
+ x: number;
2099
+ /** Pixels down from the sprite's top edge. */
2100
+ y: number;
2101
+ }
1981
2102
  /** The outline of one cell of the grid, seen from straight above. */
1982
2103
  export type TileShape = "SQUARE" | "HEXAGON";
1983
2104
  export interface TokenResponse {
@@ -2066,6 +2187,8 @@ export interface UpdateSessionBody {
2066
2187
  /** The session's new display name. */
2067
2188
  name: string;
2068
2189
  }
2190
+ /** What a cap does once its member has used all of it. */
2191
+ export type UsageLimitMode = "warn" | "block";
2069
2192
  export type UsageLimitPeriod = "daily" | "weekly" | "monthly";
2070
2193
  export interface ValidationError {
2071
2194
  loc: Array<string | number>;
@@ -2193,6 +2316,8 @@ export interface WorkflowRunAsset {
2193
2316
  duration_seconds?: number | null;
2194
2317
  /** File size in bytes. */
2195
2318
  file_size_bytes?: number | null;
2319
+ /** What an engine needs beyond the file to build a resource from it. Null when the file has none. */
2320
+ metadata?: FileMetadataView | null;
2196
2321
  }
2197
2322
  /** Delivered when a workflow run reaches a terminal state. */
2198
2323
  export interface WorkflowRunWebhookEvent {
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "1.0.48";
1
+ export const VERSION = "1.0.51";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layer_ai/sdk",
3
- "version": "1.0.48",
3
+ "version": "1.0.51",
4
4
  "description": "Official JavaScript and TypeScript SDK for Layer \u2014 AI asset creation for game studios.",
5
5
  "keywords": [
6
6
  "ai",