two-stroke 7.6.6 → 7.6.7

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.
@@ -13,7 +13,7 @@ jobs:
13
13
  ci:
14
14
  runs-on: ubuntu-latest
15
15
  steps:
16
- - uses: actions/checkout@v6
16
+ - uses: actions/checkout@v7
17
17
 
18
18
  - uses: ./.github/actions/install
19
19
 
@@ -17,7 +17,7 @@ jobs:
17
17
  ci:
18
18
  runs-on: ubuntu-latest
19
19
  steps:
20
- - uses: actions/checkout@v6
20
+ - uses: actions/checkout@v7
21
21
 
22
22
  - uses: ./.github/actions/install
23
23
 
package/bin/lint.mjs CHANGED
@@ -4,7 +4,22 @@ import fs from "fs";
4
4
  import { cmd } from "../src/cmd.mjs";
5
5
 
6
6
  if (fs.existsSync("wrangler.jsonc")) {
7
- cmd("wrangler types --strict-vars false --check");
7
+ const devVarsFiles = fs.globSync("**/.dev.vars");
8
+ const backed = [];
9
+
10
+ for (const file of devVarsFiles) {
11
+ const tmp = file + ".bak.bak";
12
+ fs.renameSync(file, tmp);
13
+ backed.push({ original: file, tmp });
14
+ }
15
+
16
+ try {
17
+ cmd("wrangler types --strict-vars false --check");
18
+ } finally {
19
+ for (const { original, tmp } of backed) {
20
+ fs.renameSync(tmp, original);
21
+ }
22
+ }
8
23
  }
9
24
  cmd("eslint --cache --max-warnings=0");
10
25
  cmd("prettier --cache --check .");
package/package.json CHANGED
@@ -12,13 +12,13 @@
12
12
  "dependencies": {
13
13
  "@cloudflare/vitest-pool-workers": "^0.16.13",
14
14
  "@sentry/cli": "^3.5.0",
15
- "@types/node": "^25.9.2",
16
- "@typescript-eslint/eslint-plugin": "^8.60.1",
15
+ "@types/node": "^26.0.1",
16
+ "@typescript-eslint/eslint-plugin": "^8.62.0",
17
17
  "@typescript-eslint/parser": "^8.60.1",
18
18
  "@vitest/runner": "^4.1.8",
19
19
  "@vitest/snapshot": "^4.1.8",
20
20
  "eslint-config-prettier": "^10.1.8",
21
- "eslint-config-two-stroke": "^1.5.4",
21
+ "eslint-config-two-stroke": "^1.5.6",
22
22
  "eslint-config-typescript": "^3.0.0",
23
23
  "jose": "^6.2.3",
24
24
  "jwk-subtle": "^1.1.7",
@@ -59,7 +59,7 @@
59
59
  "url": "https://github.com/change-engine/two-stroke"
60
60
  },
61
61
  "type": "module",
62
- "version": "7.6.6",
62
+ "version": "7.6.7",
63
63
  "devDependencies": {
64
64
  "@types/eslint": "^9.6.1",
65
65
  "eslint": "^10.4.1",
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable */
2
- // Generated by Wrangler by running `wrangler types --strict-vars false` (hash: 5eb9faed4869fd668d90631ba02bb845)
3
- // Runtime types generated with workerd@1.20260603.1 2025-09-15 disable_nodejs_fs_module,nodejs_compat
2
+ // Generated by Wrangler by running `wrangler types --strict-vars=false` (hash: 5eb9faed4869fd668d90631ba02bb845)
3
+ // Runtime types generated with workerd@1.20260625.1 2025-09-15 disable_nodejs_fs_module,nodejs_compat
4
4
  interface __BaseEnv_Env {
5
5
  TOKEN_ISSUER: string;
6
6
  TOKEN_AUDIENCE: string;
@@ -441,7 +441,8 @@ interface ExecutionContext<Props = unknown> {
441
441
  passThroughOnException(): void;
442
442
  readonly props: Props;
443
443
  cache?: CacheContext;
444
- tracing?: Tracing;
444
+ readonly access?: CloudflareAccessContext;
445
+ tracing: Tracing;
445
446
  }
446
447
  type ExportedHandlerFetchHandler<Env = unknown, CfHostMetadata = unknown, Props = unknown> = (request: Request<CfHostMetadata, IncomingRequestCfProperties<CfHostMetadata>>, env: Env, ctx: ExecutionContext<Props>) => Response | Promise<Response>;
447
448
  type ExportedHandlerConnectHandler<Env = unknown, Props = unknown> = (socket: Socket, env: Env, ctx: ExecutionContext<Props>) => void | Promise<void>;
@@ -497,6 +498,10 @@ interface CachePurgeOptions {
497
498
  interface CacheContext {
498
499
  purge(options: CachePurgeOptions): Promise<CachePurgeResult>;
499
500
  }
501
+ interface CloudflareAccessContext {
502
+ readonly aud: string;
503
+ getIdentity(): Promise<CloudflareAccessIdentity | undefined>;
504
+ }
500
505
  declare abstract class ColoLocalActorNamespace {
501
506
  get(actorId: string): Fetcher;
502
507
  }
@@ -530,7 +535,7 @@ type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
530
535
  interface DurableObjectNamespaceNewUniqueIdOptions {
531
536
  jurisdiction?: DurableObjectJurisdiction;
532
537
  }
533
- type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
538
+ type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "apac-ne" | "apac-se" | "oc" | "afr" | "me";
534
539
  type DurableObjectRoutingMode = "primary-only";
535
540
  interface DurableObjectNamespaceGetDurableObjectOptions {
536
541
  locationHint?: DurableObjectLocationHint;
@@ -625,6 +630,7 @@ interface DurableObjectFacets {
625
630
  get<T extends Rpc.DurableObjectBranded | undefined = undefined>(name: string, getStartupOptions: () => FacetStartupOptions<T> | Promise<FacetStartupOptions<T>>): Fetcher<T>;
626
631
  abort(name: string, reason: any): void;
627
632
  delete(name: string): void;
633
+ clone(src: string, dst: string): void;
628
634
  }
629
635
  interface FacetStartupOptions<T extends Rpc.DurableObjectBranded | undefined = undefined> {
630
636
  id?: DurableObjectId | string;
@@ -3300,6 +3306,28 @@ interface EventSourceEventSourceInit {
3300
3306
  withCredentials?: boolean;
3301
3307
  fetcher?: Fetcher;
3302
3308
  }
3309
+ interface ExecOutput {
3310
+ readonly stdout: ArrayBuffer;
3311
+ readonly stderr: ArrayBuffer;
3312
+ readonly exitCode: number;
3313
+ }
3314
+ interface ContainerExecOptions {
3315
+ cwd?: string;
3316
+ env?: Record<string, string>;
3317
+ user?: string;
3318
+ stdin?: ReadableStream | "pipe";
3319
+ stdout?: "pipe" | "ignore";
3320
+ stderr?: "pipe" | "ignore" | "combined";
3321
+ }
3322
+ interface ExecProcess {
3323
+ readonly stdin: WritableStream | null;
3324
+ readonly stdout: ReadableStream | null;
3325
+ readonly stderr: ReadableStream | null;
3326
+ readonly pid: number;
3327
+ readonly exitCode: Promise<number>;
3328
+ output(): Promise<ExecOutput>;
3329
+ kill(signal?: number): void;
3330
+ }
3303
3331
  interface Container {
3304
3332
  get running(): boolean;
3305
3333
  start(options?: ContainerStartupOptions): void;
@@ -3313,6 +3341,7 @@ interface Container {
3313
3341
  snapshotDirectory(options: ContainerDirectorySnapshotOptions): Promise<ContainerDirectorySnapshot>;
3314
3342
  snapshotContainer(options: ContainerSnapshotOptions): Promise<ContainerSnapshot>;
3315
3343
  interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
3344
+ exec(cmd: string[], options?: ContainerExecOptions): Promise<ExecProcess>;
3316
3345
  }
3317
3346
  interface ContainerDirectorySnapshot {
3318
3347
  id: string;
@@ -3483,11 +3512,58 @@ declare abstract class Performance {
3483
3512
  }
3484
3513
  interface Tracing {
3485
3514
  enterSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
3515
+ startActiveSpan<T, A extends unknown[]>(name: string, callback: (span: Span, ...args: A) => T, ...args: A): T;
3486
3516
  Span: typeof Span;
3487
3517
  }
3488
3518
  declare abstract class Span {
3489
3519
  get isTraced(): boolean;
3490
3520
  setAttribute(key: string, value?: (boolean | number | string)): void;
3521
+ end(): void;
3522
+ }
3523
+ /**
3524
+ * Represents the identity of a user authenticated via Cloudflare Access.
3525
+ * This matches the result of calling /cdn-cgi/access/get-identity.
3526
+ *
3527
+ * The exact structure of the returned object depends on the identity provider
3528
+ * configuration for the Access application. The fields below represent commonly
3529
+ * available properties, but additional provider-specific fields may be present.
3530
+ */
3531
+ interface CloudflareAccessIdentity extends Record<string, unknown> {
3532
+ /** The user's email address, if available from the identity provider. */
3533
+ email?: string;
3534
+ /** The user's display name. */
3535
+ name?: string;
3536
+ /** The user's unique identifier. */
3537
+ user_uuid?: string;
3538
+ /** The Cloudflare account ID. */
3539
+ account_id?: string;
3540
+ /** Login timestamp (Unix epoch seconds). */
3541
+ iat?: number;
3542
+ /** The user's IP address at authentication time. */
3543
+ ip?: string;
3544
+ /** Authentication methods used (e.g., "pwd"). */
3545
+ amr?: string[];
3546
+ /** Identity provider information. */
3547
+ idp?: {
3548
+ id: string;
3549
+ type: string;
3550
+ };
3551
+ /** Geographic information about where the user authenticated. */
3552
+ geo?: {
3553
+ country: string;
3554
+ };
3555
+ /** Group memberships from the identity provider. */
3556
+ groups?: Array<{
3557
+ id: string;
3558
+ name: string;
3559
+ email?: string;
3560
+ }>;
3561
+ /** Device posture check results, keyed by check ID. */
3562
+ devicePosture?: Record<string, unknown>;
3563
+ /** True if the user connected via Cloudflare WARP. */
3564
+ is_warp?: boolean;
3565
+ /** True if the user is authenticated via Cloudflare Gateway. */
3566
+ is_gateway?: boolean;
3491
3567
  }
3492
3568
  // ============================================================================
3493
3569
  // Agent Memory
@@ -11080,78 +11156,6 @@ declare abstract class BrowserRun {
11080
11156
  */
11081
11157
  quickAction(action: 'markdown', options: BrowserRunMarkdownOptions): Promise<Response>;
11082
11158
  }
11083
- interface BasicImageTransformations {
11084
- /**
11085
- * Maximum width in image pixels. The value must be an integer.
11086
- */
11087
- width?: number;
11088
- /**
11089
- * Maximum height in image pixels. The value must be an integer.
11090
- */
11091
- height?: number;
11092
- /**
11093
- * Resizing mode as a string. It affects interpretation of width and height
11094
- * options:
11095
- * - scale-down: Similar to contain, but the image is never enlarged. If
11096
- * the image is larger than given width or height, it will be resized.
11097
- * Otherwise its original size will be kept.
11098
- * - contain: Resizes to maximum size that fits within the given width and
11099
- * height. If only a single dimension is given (e.g. only width), the
11100
- * image will be shrunk or enlarged to exactly match that dimension.
11101
- * Aspect ratio is always preserved.
11102
- * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
11103
- * and height. If the image has an aspect ratio different from the ratio
11104
- * of width and height, it will be cropped to fit.
11105
- * - crop: The image will be shrunk and cropped to fit within the area
11106
- * specified by width and height. The image will not be enlarged. For images
11107
- * smaller than the given dimensions it's the same as scale-down. For
11108
- * images larger than the given dimensions, it's the same as cover.
11109
- * See also trim.
11110
- * - pad: Resizes to the maximum size that fits within the given width and
11111
- * height, and then fills the remaining area with a background color
11112
- * (white by default). Use of this mode is not recommended, as the same
11113
- * effect can be more efficiently achieved with the contain mode and the
11114
- * CSS object-fit: contain property.
11115
- * - squeeze: Stretches and deforms to the width and height given, even if it
11116
- * breaks aspect ratio
11117
- */
11118
- fit?: "scale-down" | "contain" | "cover" | "crop" | "pad" | "squeeze";
11119
- /**
11120
- * Image segmentation using artificial intelligence models. Sets pixels not
11121
- * within selected segment area to transparent e.g "foreground" sets every
11122
- * background pixel as transparent.
11123
- */
11124
- segment?: "foreground";
11125
- /**
11126
- * When cropping with fit: "cover", this defines the side or point that should
11127
- * be left uncropped. The value is either a string
11128
- * "left", "right", "top", "bottom", "auto", or "center" (the default),
11129
- * or an object {x, y} containing focal point coordinates in the original
11130
- * image expressed as fractions ranging from 0.0 (top or left) to 1.0
11131
- * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
11132
- * crop bottom or left and right sides as necessary, but won’t crop anything
11133
- * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
11134
- * preserve as much as possible around a point at 20% of the height of the
11135
- * source image.
11136
- */
11137
- gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | BasicImageTransformationsGravityCoordinates;
11138
- /**
11139
- * Background color to add underneath the image. Applies only to images with
11140
- * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
11141
- * hsl(…), etc.)
11142
- */
11143
- background?: string;
11144
- /**
11145
- * Number of degrees (90, 180, 270) to rotate the image by. width and height
11146
- * options refer to axes after rotation.
11147
- */
11148
- rotate?: 0 | 90 | 180 | 270 | 360;
11149
- }
11150
- interface BasicImageTransformationsGravityCoordinates {
11151
- x?: number;
11152
- y?: number;
11153
- mode?: 'remainder' | 'box-center';
11154
- }
11155
11159
  /**
11156
11160
  * In addition to the properties you can set in the RequestInit dict
11157
11161
  * that you pass as an argument to the Request constructor, you can
@@ -11190,6 +11194,8 @@ interface RequestInitCfProperties extends Record<string, unknown> {
11190
11194
  * (e.g. { '200-299': 86400, '404': 1, '500-599': 0 })
11191
11195
  */
11192
11196
  cacheTtlByStatus?: Record<string, number>;
11197
+ /** Controls how responses with a `Vary` header are cached for this request. */
11198
+ vary?: RequestInitCfPropertiesVary;
11193
11199
  /**
11194
11200
  * Explicit Cache-Control header value to set on the response stored in cache.
11195
11201
  * This gives full control over cache directives (e.g. 'public, max-age=3600, s-maxage=86400').
@@ -11227,6 +11233,17 @@ interface RequestInitCfProperties extends Record<string, unknown> {
11227
11233
  cacheReserveMinimumFileSize?: number;
11228
11234
  scrapeShield?: boolean;
11229
11235
  apps?: boolean;
11236
+ /**
11237
+ * Controls whether an outbound gRPC-web subrequest from this Worker is
11238
+ * converted to gRPC at the Cloudflare edge.
11239
+ *
11240
+ * - `"passthrough"`: forward the subrequest unchanged as gRPC-web (default).
11241
+ * - `"convert"`: convert the gRPC-web subrequest to gRPC at the edge.
11242
+ *
11243
+ * Provides per-request control over the same edge conversion behavior
11244
+ * gated by the `auto_grpc_convert` compatibility flag.
11245
+ */
11246
+ grpcWeb?: "passthrough" | "convert";
11230
11247
  image?: RequestInitCfPropertiesImage;
11231
11248
  minify?: RequestInitCfPropertiesImageMinify;
11232
11249
  mirage?: boolean;
@@ -11247,6 +11264,244 @@ interface RequestInitCfProperties extends Record<string, unknown> {
11247
11264
  */
11248
11265
  resolveOverride?: string;
11249
11266
  }
11267
+ /**
11268
+ * Controls how Workers Standard Vary handles a request header listed by an
11269
+ * origin `Vary` response header:
11270
+ *
11271
+ * - `"normalize"`: normalize the request header value before it is used in the
11272
+ * cache variance key.
11273
+ * - `"passthrough"`: use the raw request header value in the cache variance
11274
+ * key.
11275
+ * - `"bypass"`: bypass cache when the header appears in the origin `Vary`
11276
+ * response header.
11277
+ */
11278
+ type RequestInitCfPropertiesVaryAction = "normalize" | "passthrough" | "bypass";
11279
+ /** Configuration for Workers Standard Vary support. */
11280
+ interface RequestInitCfPropertiesVary {
11281
+ /** The fallback action for varied request headers not listed in `headers`. */
11282
+ default: RequestInitCfPropertiesVaryHeader;
11283
+ /**
11284
+ * Lowercase request header names and their Vary configuration.
11285
+ *
11286
+ * The `accept` header can include `media_types`, the `accept-language`
11287
+ * header can include `languages`, and other headers support only `action`.
11288
+ */
11289
+ headers?: RequestInitCfPropertiesVaryHeaders;
11290
+ }
11291
+ /** Common Vary behavior for a single request header. */
11292
+ interface RequestInitCfPropertiesVaryHeader {
11293
+ /** How this request header contributes to cache variance. */
11294
+ action: RequestInitCfPropertiesVaryAction;
11295
+ }
11296
+ /** Vary behavior for the `accept` request header. */
11297
+ interface RequestInitCfPropertiesVaryAcceptHeader extends RequestInitCfPropertiesVaryHeader {
11298
+ /**
11299
+ * Media types to keep when normalizing the `Accept` request header.
11300
+ *
11301
+ * Named `media_types` to match the serialized `cf.vary` configuration.
11302
+ */
11303
+ media_types?: string[];
11304
+ }
11305
+ /** Vary behavior for the `accept-language` request header. */
11306
+ interface RequestInitCfPropertiesVaryAcceptLanguageHeader extends RequestInitCfPropertiesVaryHeader {
11307
+ /**
11308
+ * Language tags to keep when normalizing the `Accept-Language` request
11309
+ * header.
11310
+ */
11311
+ languages?: string[];
11312
+ }
11313
+ /**
11314
+ * Lowercase request header names and their Vary behavior.
11315
+ *
11316
+ * The index signature allows arbitrary custom request headers beyond the
11317
+ * well-known `accept` and `accept-language` specializations.
11318
+ */
11319
+ interface RequestInitCfPropertiesVaryHeaders {
11320
+ accept?: RequestInitCfPropertiesVaryAcceptHeader;
11321
+ "accept-language"?: RequestInitCfPropertiesVaryAcceptLanguageHeader;
11322
+ [header: string]: RequestInitCfPropertiesVaryHeader | RequestInitCfPropertiesVaryAcceptHeader | RequestInitCfPropertiesVaryAcceptLanguageHeader | undefined;
11323
+ }
11324
+ interface BasicImageTransformations {
11325
+ /**
11326
+ * Maximum width in image pixels. The value must be an integer.
11327
+ */
11328
+ width?: number;
11329
+ /**
11330
+ * Maximum height in image pixels. The value must be an integer.
11331
+ */
11332
+ height?: number;
11333
+ /**
11334
+ * When cropping with fit: "cover", this defines the side or point that should
11335
+ * be left uncropped. The value is either a string
11336
+ * "left", "right", "top", "bottom", "auto", or "center" (the default),
11337
+ * or an object {x, y} containing focal point coordinates in the original
11338
+ * image expressed as fractions ranging from 0.0 (top or left) to 1.0
11339
+ * (bottom or right), 0.5 being the center. {fit: "cover", gravity: "top"} will
11340
+ * crop bottom or left and right sides as necessary, but won’t crop anything
11341
+ * from the top. {fit: "cover", gravity: {x:0.5, y:0.2}} will crop each side to
11342
+ * preserve as much as possible around a point at 20% of the height of the
11343
+ * source image.
11344
+ */
11345
+ gravity?: 'face' | 'left' | 'right' | 'top' | 'bottom' | 'center' | 'auto' | 'entropy' | BasicImageTransformationsGravityCoordinates;
11346
+ /**
11347
+ * Specifies how closely the image is cropped toward detected faces when combined
11348
+ * with the gravity=face option. Accepts a valid range between 0.0 (includes as much
11349
+ * of the background as possible) and 1.0 (crops the image as closely to the face as
11350
+ * possible). The default is 0.
11351
+ */
11352
+ zoom?: number;
11353
+ /**
11354
+ * Resizing mode as a string. It affects interpretation of width and height
11355
+ * options:
11356
+ * - scale-down: Similar to contain, but the image is never enlarged. If
11357
+ * the image is larger than given width or height, it will be resized.
11358
+ * Otherwise its original size will be kept.
11359
+ * - scale-up: Similar to contain, but the image is never shrunk. If the
11360
+ * image is smaller than the given width or height, it will be resized.
11361
+ * Otherwise its original size will be kept.
11362
+ * - contain: Resizes to maximum size that fits within the given width and
11363
+ * height. If only a single dimension is given (e.g. only width), the
11364
+ * image will be shrunk or enlarged to exactly match that dimension.
11365
+ * Aspect ratio is always preserved.
11366
+ * - cover: Resizes (shrinks or enlarges) to fill the entire area of width
11367
+ * and height. If the image has an aspect ratio different from the ratio
11368
+ * of width and height, it will be cropped to fit.
11369
+ * - crop: The image will be shrunk and cropped to fit within the area
11370
+ * specified by width and height. The image will not be enlarged. For images
11371
+ * smaller than the given dimensions it's the same as scale-down. For
11372
+ * images larger than the given dimensions, it's the same as cover.
11373
+ * See also trim.
11374
+ * - pad: Resizes to the maximum size that fits within the given width and
11375
+ * height, and then fills the remaining area with a background color
11376
+ * (white by default). Use of this mode is not recommended, as the same
11377
+ * effect can be more efficiently achieved with the contain mode and the
11378
+ * CSS object-fit: contain property.
11379
+ * - squeeze: Stretches and deforms to the width and height given, even if it
11380
+ * breaks aspect ratio
11381
+ */
11382
+ fit?: "scale-down" | "scale-up" | "contain" | "cover" | "crop" | "pad" | "squeeze";
11383
+ /**
11384
+ * Allows you to trim your image. Takes dpr into account and is performed before
11385
+ * resizing or rotation.
11386
+ *
11387
+ * It can be used as:
11388
+ * - left, top, right, bottom - it will specify the number of pixels to cut
11389
+ * off each side
11390
+ * - width, height - the width/height you'd like to end up with - can be used
11391
+ * in combination with the properties above
11392
+ * - border - this will automatically trim the surroundings of an image based on
11393
+ * it's color. It consists of three properties:
11394
+ * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
11395
+ * - tolerance: difference from color to treat as color
11396
+ * - keep: the number of pixels of border to keep
11397
+ */
11398
+ trim?: "border" | {
11399
+ top?: number;
11400
+ bottom?: number;
11401
+ left?: number;
11402
+ right?: number;
11403
+ width?: number;
11404
+ height?: number;
11405
+ border?: boolean | {
11406
+ color?: string;
11407
+ tolerance?: number;
11408
+ keep?: number;
11409
+ };
11410
+ };
11411
+ /**
11412
+ * Background color to add underneath the image. Applies only to images with
11413
+ * transparency (such as PNG). Accepts any CSS color (#RRGGBB, rgba(…),
11414
+ * hsl(…), etc.)
11415
+ */
11416
+ background?: string;
11417
+ /**
11418
+ * Flips the images horizontally, vertically, or both. Flipping is applied before
11419
+ * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
11420
+ * horizontally, then rotated by 90 degrees.
11421
+ */
11422
+ flip?: 'h' | 'v' | 'hv';
11423
+ /**
11424
+ * Number of degrees (90, 180, 270) to rotate the image by. width and height
11425
+ * options refer to axes after rotation.
11426
+ */
11427
+ rotate?: 0 | 90 | 180 | 270 | 360;
11428
+ /**
11429
+ * Strength of sharpening filter to apply to the image. Floating-point
11430
+ * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
11431
+ * recommended value for downscaled images.
11432
+ */
11433
+ sharpen?: number;
11434
+ /**
11435
+ * Radius of a blur filter (approximate gaussian). Maximum supported radius
11436
+ * is 250.
11437
+ */
11438
+ blur?: number;
11439
+ /**
11440
+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
11441
+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
11442
+ * ignored.
11443
+ */
11444
+ contrast?: number;
11445
+ /**
11446
+ * Increase brightness by a factor. A value of 1.0 equals no change, a value
11447
+ * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
11448
+ * 0 is ignored.
11449
+ */
11450
+ brightness?: number;
11451
+ /**
11452
+ * Increase exposure by a factor. A value of 1.0 equals no change, a value of
11453
+ * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
11454
+ */
11455
+ gamma?: number;
11456
+ /**
11457
+ * Increase contrast by a factor. A value of 1.0 equals no change, a value of
11458
+ * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
11459
+ * ignored.
11460
+ */
11461
+ saturation?: number;
11462
+ /**
11463
+ * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
11464
+ * easier to specify higher-DPI sizes in <img srcset>.
11465
+ */
11466
+ dpr?: number;
11467
+ /**
11468
+ * Adds a border around the image. The border is added after resizing. Border
11469
+ * width takes dpr into account, and can be specified either using a single
11470
+ * width property, or individually for each side.
11471
+ */
11472
+ border?: {
11473
+ color: string;
11474
+ width: number;
11475
+ } | {
11476
+ color: string;
11477
+ top: number;
11478
+ right: number;
11479
+ bottom: number;
11480
+ left: number;
11481
+ };
11482
+ /**
11483
+ * Image segmentation using artificial intelligence models. Sets pixels not
11484
+ * within selected segment area to transparent e.g "foreground" sets every
11485
+ * background pixel as transparent.
11486
+ */
11487
+ segment?: "foreground";
11488
+ /**
11489
+ * Controls the algorithm used when an image needs to be enlarged. This
11490
+ * parameter works with any fit mode that upscales, such as `contain`,
11491
+ * `cover`, and `scale-up`. It has no effect when `fit=scale-down` or when
11492
+ * the target dimensions are smaller than the source.
11493
+ * - interpolate: Uses bicubic interpolation, which may reduce image quality.
11494
+ * This is the default behavior when `upscale` is not specified.
11495
+ * - generate: Uses AI upscaling to produce sharper, more detailed results
11496
+ * when enlarging images.
11497
+ */
11498
+ upscale?: "interpolate" | "generate";
11499
+ }
11500
+ interface BasicImageTransformationsGravityCoordinates {
11501
+ x?: number;
11502
+ y?: number;
11503
+ mode?: 'remainder' | 'box-center';
11504
+ }
11250
11505
  interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
11251
11506
  /**
11252
11507
  * Absolute URL of the image file to use for the drawing. It can be any of
@@ -11301,39 +11556,6 @@ interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
11301
11556
  right?: number;
11302
11557
  }
11303
11558
  interface RequestInitCfPropertiesImage extends BasicImageTransformations {
11304
- /**
11305
- * Device Pixel Ratio. Default 1. Multiplier for width/height that makes it
11306
- * easier to specify higher-DPI sizes in <img srcset>.
11307
- */
11308
- dpr?: number;
11309
- /**
11310
- * Allows you to trim your image. Takes dpr into account and is performed before
11311
- * resizing or rotation.
11312
- *
11313
- * It can be used as:
11314
- * - left, top, right, bottom - it will specify the number of pixels to cut
11315
- * off each side
11316
- * - width, height - the width/height you'd like to end up with - can be used
11317
- * in combination with the properties above
11318
- * - border - this will automatically trim the surroundings of an image based on
11319
- * it's color. It consists of three properties:
11320
- * - color: rgb or hex representation of the color you wish to trim (todo: verify the rgba bit)
11321
- * - tolerance: difference from color to treat as color
11322
- * - keep: the number of pixels of border to keep
11323
- */
11324
- trim?: "border" | {
11325
- top?: number;
11326
- bottom?: number;
11327
- left?: number;
11328
- right?: number;
11329
- width?: number;
11330
- height?: number;
11331
- border?: boolean | {
11332
- color?: string;
11333
- tolerance?: number;
11334
- keep?: number;
11335
- };
11336
- };
11337
11559
  /**
11338
11560
  * Quality setting from 1-100 (useful values are in 60-90 range). Lower values
11339
11561
  * make images look worse, but load faster. The default is 85. It applies only
@@ -11375,17 +11597,6 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
11375
11597
  * output formats always discard metadata.
11376
11598
  */
11377
11599
  metadata?: "keep" | "copyright" | "none";
11378
- /**
11379
- * Strength of sharpening filter to apply to the image. Floating-point
11380
- * number between 0 (no sharpening, default) and 10 (maximum). 1.0 is a
11381
- * recommended value for downscaled images.
11382
- */
11383
- sharpen?: number;
11384
- /**
11385
- * Radius of a blur filter (approximate gaussian). Maximum supported radius
11386
- * is 250.
11387
- */
11388
- blur?: number;
11389
11600
  /**
11390
11601
  * Overlays are drawn in the order they appear in the array (last array
11391
11602
  * entry is the topmost layer).
@@ -11397,50 +11608,6 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
11397
11608
  * the origin.
11398
11609
  */
11399
11610
  "origin-auth"?: "share-publicly";
11400
- /**
11401
- * Adds a border around the image. The border is added after resizing. Border
11402
- * width takes dpr into account, and can be specified either using a single
11403
- * width property, or individually for each side.
11404
- */
11405
- border?: {
11406
- color: string;
11407
- width: number;
11408
- } | {
11409
- color: string;
11410
- top: number;
11411
- right: number;
11412
- bottom: number;
11413
- left: number;
11414
- };
11415
- /**
11416
- * Increase brightness by a factor. A value of 1.0 equals no change, a value
11417
- * of 0.5 equals half brightness, and a value of 2.0 equals twice as bright.
11418
- * 0 is ignored.
11419
- */
11420
- brightness?: number;
11421
- /**
11422
- * Increase contrast by a factor. A value of 1.0 equals no change, a value of
11423
- * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
11424
- * ignored.
11425
- */
11426
- contrast?: number;
11427
- /**
11428
- * Increase exposure by a factor. A value of 1.0 equals no change, a value of
11429
- * 0.5 darkens the image, and a value of 2.0 lightens the image. 0 is ignored.
11430
- */
11431
- gamma?: number;
11432
- /**
11433
- * Increase contrast by a factor. A value of 1.0 equals no change, a value of
11434
- * 0.5 equals low contrast, and a value of 2.0 equals high contrast. 0 is
11435
- * ignored.
11436
- */
11437
- saturation?: number;
11438
- /**
11439
- * Flips the images horizontally, vertically, or both. Flipping is applied before
11440
- * rotation, so if you apply flip=h,rotate=90 then the image will be flipped
11441
- * horizontally, then rotated by 90 degrees.
11442
- */
11443
- flip?: 'h' | 'v' | 'hv';
11444
11611
  /**
11445
11612
  * Slightly reduces latency on a cache miss by selecting a
11446
11613
  * quickest-to-compress file format, at a cost of increased file size and
@@ -12929,6 +13096,7 @@ declare namespace CloudflareWorkersModule {
12929
13096
  timeout?: WorkflowTimeoutDuration | number;
12930
13097
  sensitive?: WorkflowStepSensitivity;
12931
13098
  };
13099
+ export type WorkflowStepRollbackConfig = Pick<WorkflowStepConfig, 'retries' | 'timeout'>;
12932
13100
  export type WorkflowCronSchedule = {
12933
13101
  /** Cron expression that triggered this event. */
12934
13102
  cron: string;
@@ -12957,14 +13125,16 @@ declare namespace CloudflareWorkersModule {
12957
13125
  config: WorkflowStepConfig;
12958
13126
  };
12959
13127
  export type WorkflowRollbackContext<T = unknown> = {
13128
+ ctx: WorkflowStepContext;
12960
13129
  error: Error;
12961
13130
  output: T | undefined;
13131
+ /** @deprecated Use `ctx.step.name` and `ctx.step.count` instead. */
12962
13132
  stepName: string;
12963
13133
  };
12964
13134
  export type WorkflowRollbackHandler<T = unknown> = (ctx: WorkflowRollbackContext<T>) => Promise<void>;
12965
13135
  export type WorkflowStepRollbackOptions<T = unknown> = {
12966
- rollback?: WorkflowRollbackHandler<T>;
12967
- rollbackConfig?: WorkflowStepConfig;
13136
+ rollback: WorkflowRollbackHandler<T>;
13137
+ rollbackConfig?: WorkflowStepRollbackConfig;
12968
13138
  };
12969
13139
  export abstract class WorkflowStep {
12970
13140
  do<T extends Rpc.Serializable<T>>(name: string, callback: (ctx: WorkflowStepContext) => Promise<T>, rollbackOptions?: WorkflowStepRollbackOptions<T>): Promise<T>;
@@ -13859,7 +14029,7 @@ declare namespace TailStream {
13859
14029
  interface ConnectEventInfo {
13860
14030
  readonly type: "connect";
13861
14031
  }
13862
- type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError";
14032
+ type EventOutcome = "ok" | "canceled" | "exception" | "unknown" | "killSwitch" | "daemonDown" | "exceededCpu" | "exceededMemory" | "loadShed" | "responseStreamDisconnected" | "scriptNotFound" | "internalError" | "exceededWallTime";
13863
14033
  interface ScriptVersion {
13864
14034
  readonly id: string;
13865
14035
  readonly tag?: string;