@economic/agents 0.0.1-alpha.19 → 0.0.1-alpha.20
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/index.d.mts +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -184,7 +184,7 @@ declare abstract class AIChatAgent<Env extends Cloudflare.Env = Cloudflare.Env>
|
|
|
184
184
|
* Typical uses include auth, rate limits, or feature flags — all logic lives here;
|
|
185
185
|
* the `guard` decorator only forwards `body` and handles the return shape.
|
|
186
186
|
*/
|
|
187
|
-
type GuardFn =
|
|
187
|
+
type GuardFn<TBody = Record<string, unknown>> = (body: TBody | undefined) => Response | void | Promise<Response | void>;
|
|
188
188
|
/**
|
|
189
189
|
* Method decorator (TypeScript 5+ stage-3) that runs `guardFn` with the second
|
|
190
190
|
* argument's `body` (the chat request body). If `guardFn` returns a
|
|
@@ -211,7 +211,7 @@ type GuardFn = (body: Record<string, unknown> | undefined) => Response | void |
|
|
|
211
211
|
* }
|
|
212
212
|
* ```
|
|
213
213
|
*/
|
|
214
|
-
declare function guard(guardFn: GuardFn): (target:
|
|
214
|
+
declare function guard(guardFn: GuardFn): (target: (...args: unknown[]) => Promise<Response>, _context: ClassMethodDecoratorContext) => (this: unknown, ...args: unknown[]) => Promise<Response>;
|
|
215
215
|
//#endregion
|
|
216
216
|
//#region src/types.d.ts
|
|
217
217
|
/**
|