@cloudflare/workers-types 4.20260528.1 → 4.20260530.1
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/2021-11-03/index.d.ts +262 -0
- package/2021-11-03/index.ts +262 -0
- package/2022-01-31/index.d.ts +262 -0
- package/2022-01-31/index.ts +262 -0
- package/2022-03-21/index.d.ts +262 -0
- package/2022-03-21/index.ts +262 -0
- package/2022-08-04/index.d.ts +262 -0
- package/2022-08-04/index.ts +262 -0
- package/2022-10-31/index.d.ts +262 -0
- package/2022-10-31/index.ts +262 -0
- package/2022-11-30/index.d.ts +262 -0
- package/2022-11-30/index.ts +262 -0
- package/2023-03-01/index.d.ts +262 -0
- package/2023-03-01/index.ts +262 -0
- package/2023-07-01/index.d.ts +262 -0
- package/2023-07-01/index.ts +262 -0
- package/experimental/index.d.ts +262 -0
- package/experimental/index.ts +262 -0
- package/index.d.ts +262 -0
- package/index.ts +262 -0
- package/latest/index.d.ts +262 -0
- package/latest/index.ts +262 -0
- package/oldest/index.d.ts +262 -0
- package/oldest/index.ts +262 -0
- package/package.json +1 -1
package/2021-11-03/index.d.ts
CHANGED
|
@@ -3925,6 +3925,239 @@ declare abstract class Span {
|
|
|
3925
3925
|
get isTraced(): boolean;
|
|
3926
3926
|
setAttribute(key: string, value?: boolean | number | string): void;
|
|
3927
3927
|
}
|
|
3928
|
+
// ============================================================================
|
|
3929
|
+
// Agent Memory
|
|
3930
|
+
//
|
|
3931
|
+
// Public type surface for user Workers binding to an Agent Memory namespace.
|
|
3932
|
+
// ============================================================================
|
|
3933
|
+
/** Memory type — every memory is classified into exactly one. */
|
|
3934
|
+
type AgentMemoryMemoryType = "fact" | "event" | "instruction" | "task";
|
|
3935
|
+
/** Search intensity for recall. */
|
|
3936
|
+
type AgentMemoryThinkingLevel = "low" | "medium" | "high";
|
|
3937
|
+
/** Response verbosity for recall. */
|
|
3938
|
+
type AgentMemoryResponseLength = "short" | "medium" | "long";
|
|
3939
|
+
/** A conversation message passed to ingest(). */
|
|
3940
|
+
interface AgentMemoryMessage {
|
|
3941
|
+
role: "system" | "user" | "assistant";
|
|
3942
|
+
content: string;
|
|
3943
|
+
/** Optional message timestamp. */
|
|
3944
|
+
timestamp?: Date;
|
|
3945
|
+
}
|
|
3946
|
+
/** Raw memory content passed to remember(). */
|
|
3947
|
+
interface AgentMemoryIncomingMemory {
|
|
3948
|
+
/** Raw memory content. The service classifies and summarizes automatically. */
|
|
3949
|
+
content: string;
|
|
3950
|
+
/** Optional session identifier to associate with this memory. */
|
|
3951
|
+
sessionId?: string | null | undefined;
|
|
3952
|
+
}
|
|
3953
|
+
/** A stored memory returned from remember(), get(), and delete(). */
|
|
3954
|
+
interface AgentMemoryMemory {
|
|
3955
|
+
/** Memory ID. */
|
|
3956
|
+
id: string;
|
|
3957
|
+
/** Memory type. */
|
|
3958
|
+
type: AgentMemoryMemoryType;
|
|
3959
|
+
/** Text summary. */
|
|
3960
|
+
summary: string;
|
|
3961
|
+
/** Memory text. */
|
|
3962
|
+
content: string;
|
|
3963
|
+
/** Session that created this memory. */
|
|
3964
|
+
sessionId: string | null;
|
|
3965
|
+
/** Memory creation time. */
|
|
3966
|
+
createdAt: Date;
|
|
3967
|
+
/** Memory last-update time. */
|
|
3968
|
+
updatedAt: Date;
|
|
3969
|
+
}
|
|
3970
|
+
/** Single entry in a list() response. Same shape as Memory minus full content. */
|
|
3971
|
+
type AgentMemoryMemoryListEntry = Omit<AgentMemoryMemory, "content">;
|
|
3972
|
+
/** A scored memory candidate in a recall result. */
|
|
3973
|
+
interface AgentMemoryScoredCandidate {
|
|
3974
|
+
/** Candidate ID. */
|
|
3975
|
+
id: string;
|
|
3976
|
+
/** Text summary. */
|
|
3977
|
+
summary: string;
|
|
3978
|
+
/** Session that created this candidate, when known. */
|
|
3979
|
+
sessionId: string | null;
|
|
3980
|
+
/** Relevance score (higher is better). Comparable only within a single query. */
|
|
3981
|
+
score: number;
|
|
3982
|
+
}
|
|
3983
|
+
/** Options for the ingest() method. */
|
|
3984
|
+
interface AgentMemoryIngestOptions {
|
|
3985
|
+
/** Session identifier to associate with memories created during ingestion. */
|
|
3986
|
+
sessionId?: string | null | undefined;
|
|
3987
|
+
}
|
|
3988
|
+
/** Options for the getSummary() method. */
|
|
3989
|
+
interface AgentMemoryGetSummaryOptions {
|
|
3990
|
+
/** Session identifier to retrieve session summary for. */
|
|
3991
|
+
sessionId?: string | null | undefined;
|
|
3992
|
+
}
|
|
3993
|
+
/** Response from the getSummary() method. */
|
|
3994
|
+
interface AgentMemoryGetSummaryResponse {
|
|
3995
|
+
/** Markdown summary. */
|
|
3996
|
+
summary: string;
|
|
3997
|
+
}
|
|
3998
|
+
/**
|
|
3999
|
+
* Options for the recall() method.
|
|
4000
|
+
*
|
|
4001
|
+
* `referenceDate` accepts a Date object, an ISO-8601 date string
|
|
4002
|
+
* (YYYY-MM-DD), or a full ISO-8601 datetime string. When provided, this
|
|
4003
|
+
* date is used as "today" for resolving relative time references
|
|
4004
|
+
* ("how many days ago", "last week") instead of the server's wall-clock time.
|
|
4005
|
+
*/
|
|
4006
|
+
interface AgentMemoryRecallOptions {
|
|
4007
|
+
/** Recall intensity: "low" (default), "medium", or "high". */
|
|
4008
|
+
thinkingLevel?: AgentMemoryThinkingLevel;
|
|
4009
|
+
/** Response verbosity: "short", "medium" (default), or "long". */
|
|
4010
|
+
responseLength?: AgentMemoryResponseLength;
|
|
4011
|
+
/** Temporal anchor for date arithmetic. */
|
|
4012
|
+
referenceDate?: Date | string;
|
|
4013
|
+
}
|
|
4014
|
+
/** Response from the recall() method. */
|
|
4015
|
+
interface AgentMemoryRecallResult {
|
|
4016
|
+
/** Number of memories retrieved. */
|
|
4017
|
+
count: number;
|
|
4018
|
+
/** LLM-generated answer synthesizing the matching memories. */
|
|
4019
|
+
answer: string;
|
|
4020
|
+
/** Matching memories ranked by relevance. */
|
|
4021
|
+
candidates: AgentMemoryScoredCandidate[];
|
|
4022
|
+
}
|
|
4023
|
+
/**
|
|
4024
|
+
* Options for the list() method.
|
|
4025
|
+
*
|
|
4026
|
+
* `cursor` is the opaque continuation token returned by the previous page;
|
|
4027
|
+
* pass it back unchanged to fetch the next page. `sessionId` and `type`
|
|
4028
|
+
* are exact-match filters; combining them is allowed.
|
|
4029
|
+
*/
|
|
4030
|
+
interface AgentMemoryListMemoriesOptions {
|
|
4031
|
+
/** Maximum number of memories to return. Default 20, max 500. */
|
|
4032
|
+
limit?: number;
|
|
4033
|
+
/** Opaque cursor from a previous page. */
|
|
4034
|
+
cursor?: string;
|
|
4035
|
+
/** Exact-match session filter. */
|
|
4036
|
+
sessionId?: string;
|
|
4037
|
+
/** Exact-match memory-type filter. */
|
|
4038
|
+
type?: AgentMemoryMemoryType;
|
|
4039
|
+
}
|
|
4040
|
+
/** Response from the list() method. */
|
|
4041
|
+
interface AgentMemoryListMemoriesResult {
|
|
4042
|
+
memories: AgentMemoryMemoryListEntry[];
|
|
4043
|
+
/** Continuation cursor; absent when this page exhausted the result set. */
|
|
4044
|
+
cursor?: string;
|
|
4045
|
+
}
|
|
4046
|
+
/**
|
|
4047
|
+
* A single Agent Memory profile, scoped to a profile name.
|
|
4048
|
+
*
|
|
4049
|
+
* Returned by {@link AgentMemoryNamespace.getProfile}.
|
|
4050
|
+
*/
|
|
4051
|
+
declare abstract class AgentMemoryProfile {
|
|
4052
|
+
/**
|
|
4053
|
+
* Retrieve a memory by ID.
|
|
4054
|
+
*
|
|
4055
|
+
* @param memoryId - ULID of the memory to retrieve.
|
|
4056
|
+
* @throws if the memory does not exist.
|
|
4057
|
+
*/
|
|
4058
|
+
get(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4059
|
+
/**
|
|
4060
|
+
* Delete a memory by ID.
|
|
4061
|
+
*
|
|
4062
|
+
* Removes the memory and any source messages linked by the memory's
|
|
4063
|
+
* source message IDs.
|
|
4064
|
+
*
|
|
4065
|
+
* @param memoryId - ULID of the memory to delete.
|
|
4066
|
+
* @throws if the memory does not exist.
|
|
4067
|
+
*/
|
|
4068
|
+
delete(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4069
|
+
/**
|
|
4070
|
+
* Store a memory in this profile. The content is automatically classified,
|
|
4071
|
+
* summarized, and indexed.
|
|
4072
|
+
*
|
|
4073
|
+
* @param memory - Raw memory content to persist.
|
|
4074
|
+
*/
|
|
4075
|
+
remember(memory: AgentMemoryIncomingMemory): Promise<AgentMemoryMemory>;
|
|
4076
|
+
/**
|
|
4077
|
+
* Extract memories from a conversation.
|
|
4078
|
+
*
|
|
4079
|
+
* @param messages - Conversation messages to extract memories from.
|
|
4080
|
+
* @param options - Optional ingest options.
|
|
4081
|
+
*/
|
|
4082
|
+
ingest(
|
|
4083
|
+
messages: Iterable<AgentMemoryMessage>,
|
|
4084
|
+
options?: AgentMemoryIngestOptions,
|
|
4085
|
+
): Promise<void>;
|
|
4086
|
+
/**
|
|
4087
|
+
* Get a profile summary.
|
|
4088
|
+
*
|
|
4089
|
+
* @param options - Optional getSummary options.
|
|
4090
|
+
*/
|
|
4091
|
+
getSummary(
|
|
4092
|
+
options?: AgentMemoryGetSummaryOptions,
|
|
4093
|
+
): Promise<AgentMemoryGetSummaryResponse>;
|
|
4094
|
+
/**
|
|
4095
|
+
* Recall memories in this profile.
|
|
4096
|
+
*
|
|
4097
|
+
* @param query - Recall query matched against memory content and keywords.
|
|
4098
|
+
* @param options - Optional recall parameters.
|
|
4099
|
+
* @returns Matching memories with relevance scores and a synthesized answer.
|
|
4100
|
+
*/
|
|
4101
|
+
recall(
|
|
4102
|
+
query: string,
|
|
4103
|
+
options?: AgentMemoryRecallOptions,
|
|
4104
|
+
): Promise<AgentMemoryRecallResult>;
|
|
4105
|
+
/**
|
|
4106
|
+
* List active memories in this profile.
|
|
4107
|
+
*
|
|
4108
|
+
* Returns a paginated, filterable view of stored memories. Superseded
|
|
4109
|
+
* versions are excluded. Use the returned `cursor` (when present) to
|
|
4110
|
+
* fetch the next page.
|
|
4111
|
+
*
|
|
4112
|
+
* @param options - Optional pagination and filter options.
|
|
4113
|
+
*/
|
|
4114
|
+
list(
|
|
4115
|
+
options?: AgentMemoryListMemoriesOptions,
|
|
4116
|
+
): Promise<AgentMemoryListMemoriesResult>;
|
|
4117
|
+
/**
|
|
4118
|
+
* Soft-delete every memory and message in this profile that is tagged
|
|
4119
|
+
* with `sessionId`.
|
|
4120
|
+
*
|
|
4121
|
+
* Idempotent: deleting a sessionId that has no rows is a no-op.
|
|
4122
|
+
*
|
|
4123
|
+
* @param sessionId - Session to delete.
|
|
4124
|
+
*/
|
|
4125
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
4126
|
+
}
|
|
4127
|
+
/**
|
|
4128
|
+
* Namespace-level Agent Memory binding.
|
|
4129
|
+
*
|
|
4130
|
+
* Used as the type of an `env.MEMORY`-style binding backed by the Agent
|
|
4131
|
+
* Memory product.
|
|
4132
|
+
*
|
|
4133
|
+
* @example
|
|
4134
|
+
* ```ts
|
|
4135
|
+
* export default {
|
|
4136
|
+
* async fetch(_request: Request, env: Env): Promise<Response> {
|
|
4137
|
+
* const profile = await env.MEMORY.getProfile("wrangler-e2e");
|
|
4138
|
+
* const summary = await profile.getSummary();
|
|
4139
|
+
* return Response.json(summary);
|
|
4140
|
+
* },
|
|
4141
|
+
* };
|
|
4142
|
+
* ```
|
|
4143
|
+
*/
|
|
4144
|
+
declare abstract class AgentMemoryNamespace {
|
|
4145
|
+
/**
|
|
4146
|
+
* Get a memory profile by name. Profiles are isolated by namespace and
|
|
4147
|
+
* addressed by a compound key (namespaceId:profileName).
|
|
4148
|
+
*
|
|
4149
|
+
* @param profileName - Profile name (validated against naming rules).
|
|
4150
|
+
* @returns RPC target for interacting with the profile.
|
|
4151
|
+
*/
|
|
4152
|
+
getProfile(profileName: string): Promise<AgentMemoryProfile>;
|
|
4153
|
+
/**
|
|
4154
|
+
* Soft-delete a profile and schedule deferred purge. Marks all
|
|
4155
|
+
* memories and messages as deleted.
|
|
4156
|
+
*
|
|
4157
|
+
* @param profileName - Name of the profile to delete.
|
|
4158
|
+
*/
|
|
4159
|
+
deleteProfile(profileName: string): Promise<void>;
|
|
4160
|
+
}
|
|
3928
4161
|
// ============ AI Search Error Interfaces ============
|
|
3929
4162
|
interface AiSearchInternalError extends Error {}
|
|
3930
4163
|
interface AiSearchNotFoundError extends Error {}
|
|
@@ -12038,6 +12271,21 @@ interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
|
12038
12271
|
* (form a line).
|
|
12039
12272
|
*/
|
|
12040
12273
|
repeat?: true | "x" | "y";
|
|
12274
|
+
/**
|
|
12275
|
+
* How to combine the foreground and backdrop pixels to create the result
|
|
12276
|
+
*/
|
|
12277
|
+
composite?: /** Foreground drawn on top of backdrop (default) */
|
|
12278
|
+
| "over"
|
|
12279
|
+
/** Foreground shown only where backdrop is opaque */
|
|
12280
|
+
| "in"
|
|
12281
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
12282
|
+
| "atop"
|
|
12283
|
+
/** Foreground shown only where backdrop is transparent */
|
|
12284
|
+
| "out"
|
|
12285
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
12286
|
+
| "xor"
|
|
12287
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
12288
|
+
| "lighter";
|
|
12041
12289
|
/**
|
|
12042
12290
|
* Position of the overlay image relative to a given edge. Each property is
|
|
12043
12291
|
* an offset in pixels. 0 aligns exactly to the edge. For example, left: 10
|
|
@@ -13381,11 +13629,25 @@ type ImageTransform = {
|
|
|
13381
13629
|
type ImageDrawOptions = {
|
|
13382
13630
|
opacity?: number;
|
|
13383
13631
|
repeat?: boolean | string;
|
|
13632
|
+
composite?: ImageCompositeMode;
|
|
13384
13633
|
top?: number;
|
|
13385
13634
|
left?: number;
|
|
13386
13635
|
bottom?: number;
|
|
13387
13636
|
right?: number;
|
|
13388
13637
|
};
|
|
13638
|
+
type ImageCompositeMode =
|
|
13639
|
+
/** Foreground drawn on top of backdrop (default) */
|
|
13640
|
+
| "over"
|
|
13641
|
+
/** Foreground shown only where backdrop is opaque */
|
|
13642
|
+
| "in"
|
|
13643
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
13644
|
+
| "atop"
|
|
13645
|
+
/** Foreground shown only where backdrop is transparent */
|
|
13646
|
+
| "out"
|
|
13647
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
13648
|
+
| "xor"
|
|
13649
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
13650
|
+
| "lighter";
|
|
13389
13651
|
type ImageInputOptions = {
|
|
13390
13652
|
encoding?: "base64";
|
|
13391
13653
|
};
|
package/2021-11-03/index.ts
CHANGED
|
@@ -3931,6 +3931,239 @@ export declare abstract class Span {
|
|
|
3931
3931
|
get isTraced(): boolean;
|
|
3932
3932
|
setAttribute(key: string, value?: boolean | number | string): void;
|
|
3933
3933
|
}
|
|
3934
|
+
// ============================================================================
|
|
3935
|
+
// Agent Memory
|
|
3936
|
+
//
|
|
3937
|
+
// Public type surface for user Workers binding to an Agent Memory namespace.
|
|
3938
|
+
// ============================================================================
|
|
3939
|
+
/** Memory type — every memory is classified into exactly one. */
|
|
3940
|
+
export type AgentMemoryMemoryType = "fact" | "event" | "instruction" | "task";
|
|
3941
|
+
/** Search intensity for recall. */
|
|
3942
|
+
export type AgentMemoryThinkingLevel = "low" | "medium" | "high";
|
|
3943
|
+
/** Response verbosity for recall. */
|
|
3944
|
+
export type AgentMemoryResponseLength = "short" | "medium" | "long";
|
|
3945
|
+
/** A conversation message passed to ingest(). */
|
|
3946
|
+
export interface AgentMemoryMessage {
|
|
3947
|
+
role: "system" | "user" | "assistant";
|
|
3948
|
+
content: string;
|
|
3949
|
+
/** Optional message timestamp. */
|
|
3950
|
+
timestamp?: Date;
|
|
3951
|
+
}
|
|
3952
|
+
/** Raw memory content passed to remember(). */
|
|
3953
|
+
export interface AgentMemoryIncomingMemory {
|
|
3954
|
+
/** Raw memory content. The service classifies and summarizes automatically. */
|
|
3955
|
+
content: string;
|
|
3956
|
+
/** Optional session identifier to associate with this memory. */
|
|
3957
|
+
sessionId?: string | null | undefined;
|
|
3958
|
+
}
|
|
3959
|
+
/** A stored memory returned from remember(), get(), and delete(). */
|
|
3960
|
+
export interface AgentMemoryMemory {
|
|
3961
|
+
/** Memory ID. */
|
|
3962
|
+
id: string;
|
|
3963
|
+
/** Memory type. */
|
|
3964
|
+
type: AgentMemoryMemoryType;
|
|
3965
|
+
/** Text summary. */
|
|
3966
|
+
summary: string;
|
|
3967
|
+
/** Memory text. */
|
|
3968
|
+
content: string;
|
|
3969
|
+
/** Session that created this memory. */
|
|
3970
|
+
sessionId: string | null;
|
|
3971
|
+
/** Memory creation time. */
|
|
3972
|
+
createdAt: Date;
|
|
3973
|
+
/** Memory last-update time. */
|
|
3974
|
+
updatedAt: Date;
|
|
3975
|
+
}
|
|
3976
|
+
/** Single entry in a list() response. Same shape as Memory minus full content. */
|
|
3977
|
+
export type AgentMemoryMemoryListEntry = Omit<AgentMemoryMemory, "content">;
|
|
3978
|
+
/** A scored memory candidate in a recall result. */
|
|
3979
|
+
export interface AgentMemoryScoredCandidate {
|
|
3980
|
+
/** Candidate ID. */
|
|
3981
|
+
id: string;
|
|
3982
|
+
/** Text summary. */
|
|
3983
|
+
summary: string;
|
|
3984
|
+
/** Session that created this candidate, when known. */
|
|
3985
|
+
sessionId: string | null;
|
|
3986
|
+
/** Relevance score (higher is better). Comparable only within a single query. */
|
|
3987
|
+
score: number;
|
|
3988
|
+
}
|
|
3989
|
+
/** Options for the ingest() method. */
|
|
3990
|
+
export interface AgentMemoryIngestOptions {
|
|
3991
|
+
/** Session identifier to associate with memories created during ingestion. */
|
|
3992
|
+
sessionId?: string | null | undefined;
|
|
3993
|
+
}
|
|
3994
|
+
/** Options for the getSummary() method. */
|
|
3995
|
+
export interface AgentMemoryGetSummaryOptions {
|
|
3996
|
+
/** Session identifier to retrieve session summary for. */
|
|
3997
|
+
sessionId?: string | null | undefined;
|
|
3998
|
+
}
|
|
3999
|
+
/** Response from the getSummary() method. */
|
|
4000
|
+
export interface AgentMemoryGetSummaryResponse {
|
|
4001
|
+
/** Markdown summary. */
|
|
4002
|
+
summary: string;
|
|
4003
|
+
}
|
|
4004
|
+
/**
|
|
4005
|
+
* Options for the recall() method.
|
|
4006
|
+
*
|
|
4007
|
+
* `referenceDate` accepts a Date object, an ISO-8601 date string
|
|
4008
|
+
* (YYYY-MM-DD), or a full ISO-8601 datetime string. When provided, this
|
|
4009
|
+
* date is used as "today" for resolving relative time references
|
|
4010
|
+
* ("how many days ago", "last week") instead of the server's wall-clock time.
|
|
4011
|
+
*/
|
|
4012
|
+
export interface AgentMemoryRecallOptions {
|
|
4013
|
+
/** Recall intensity: "low" (default), "medium", or "high". */
|
|
4014
|
+
thinkingLevel?: AgentMemoryThinkingLevel;
|
|
4015
|
+
/** Response verbosity: "short", "medium" (default), or "long". */
|
|
4016
|
+
responseLength?: AgentMemoryResponseLength;
|
|
4017
|
+
/** Temporal anchor for date arithmetic. */
|
|
4018
|
+
referenceDate?: Date | string;
|
|
4019
|
+
}
|
|
4020
|
+
/** Response from the recall() method. */
|
|
4021
|
+
export interface AgentMemoryRecallResult {
|
|
4022
|
+
/** Number of memories retrieved. */
|
|
4023
|
+
count: number;
|
|
4024
|
+
/** LLM-generated answer synthesizing the matching memories. */
|
|
4025
|
+
answer: string;
|
|
4026
|
+
/** Matching memories ranked by relevance. */
|
|
4027
|
+
candidates: AgentMemoryScoredCandidate[];
|
|
4028
|
+
}
|
|
4029
|
+
/**
|
|
4030
|
+
* Options for the list() method.
|
|
4031
|
+
*
|
|
4032
|
+
* `cursor` is the opaque continuation token returned by the previous page;
|
|
4033
|
+
* pass it back unchanged to fetch the next page. `sessionId` and `type`
|
|
4034
|
+
* are exact-match filters; combining them is allowed.
|
|
4035
|
+
*/
|
|
4036
|
+
export interface AgentMemoryListMemoriesOptions {
|
|
4037
|
+
/** Maximum number of memories to return. Default 20, max 500. */
|
|
4038
|
+
limit?: number;
|
|
4039
|
+
/** Opaque cursor from a previous page. */
|
|
4040
|
+
cursor?: string;
|
|
4041
|
+
/** Exact-match session filter. */
|
|
4042
|
+
sessionId?: string;
|
|
4043
|
+
/** Exact-match memory-type filter. */
|
|
4044
|
+
type?: AgentMemoryMemoryType;
|
|
4045
|
+
}
|
|
4046
|
+
/** Response from the list() method. */
|
|
4047
|
+
export interface AgentMemoryListMemoriesResult {
|
|
4048
|
+
memories: AgentMemoryMemoryListEntry[];
|
|
4049
|
+
/** Continuation cursor; absent when this page exhausted the result set. */
|
|
4050
|
+
cursor?: string;
|
|
4051
|
+
}
|
|
4052
|
+
/**
|
|
4053
|
+
* A single Agent Memory profile, scoped to a profile name.
|
|
4054
|
+
*
|
|
4055
|
+
* Returned by {@link AgentMemoryNamespace.getProfile}.
|
|
4056
|
+
*/
|
|
4057
|
+
export declare abstract class AgentMemoryProfile {
|
|
4058
|
+
/**
|
|
4059
|
+
* Retrieve a memory by ID.
|
|
4060
|
+
*
|
|
4061
|
+
* @param memoryId - ULID of the memory to retrieve.
|
|
4062
|
+
* @throws if the memory does not exist.
|
|
4063
|
+
*/
|
|
4064
|
+
get(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4065
|
+
/**
|
|
4066
|
+
* Delete a memory by ID.
|
|
4067
|
+
*
|
|
4068
|
+
* Removes the memory and any source messages linked by the memory's
|
|
4069
|
+
* source message IDs.
|
|
4070
|
+
*
|
|
4071
|
+
* @param memoryId - ULID of the memory to delete.
|
|
4072
|
+
* @throws if the memory does not exist.
|
|
4073
|
+
*/
|
|
4074
|
+
delete(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4075
|
+
/**
|
|
4076
|
+
* Store a memory in this profile. The content is automatically classified,
|
|
4077
|
+
* summarized, and indexed.
|
|
4078
|
+
*
|
|
4079
|
+
* @param memory - Raw memory content to persist.
|
|
4080
|
+
*/
|
|
4081
|
+
remember(memory: AgentMemoryIncomingMemory): Promise<AgentMemoryMemory>;
|
|
4082
|
+
/**
|
|
4083
|
+
* Extract memories from a conversation.
|
|
4084
|
+
*
|
|
4085
|
+
* @param messages - Conversation messages to extract memories from.
|
|
4086
|
+
* @param options - Optional ingest options.
|
|
4087
|
+
*/
|
|
4088
|
+
ingest(
|
|
4089
|
+
messages: Iterable<AgentMemoryMessage>,
|
|
4090
|
+
options?: AgentMemoryIngestOptions,
|
|
4091
|
+
): Promise<void>;
|
|
4092
|
+
/**
|
|
4093
|
+
* Get a profile summary.
|
|
4094
|
+
*
|
|
4095
|
+
* @param options - Optional getSummary options.
|
|
4096
|
+
*/
|
|
4097
|
+
getSummary(
|
|
4098
|
+
options?: AgentMemoryGetSummaryOptions,
|
|
4099
|
+
): Promise<AgentMemoryGetSummaryResponse>;
|
|
4100
|
+
/**
|
|
4101
|
+
* Recall memories in this profile.
|
|
4102
|
+
*
|
|
4103
|
+
* @param query - Recall query matched against memory content and keywords.
|
|
4104
|
+
* @param options - Optional recall parameters.
|
|
4105
|
+
* @returns Matching memories with relevance scores and a synthesized answer.
|
|
4106
|
+
*/
|
|
4107
|
+
recall(
|
|
4108
|
+
query: string,
|
|
4109
|
+
options?: AgentMemoryRecallOptions,
|
|
4110
|
+
): Promise<AgentMemoryRecallResult>;
|
|
4111
|
+
/**
|
|
4112
|
+
* List active memories in this profile.
|
|
4113
|
+
*
|
|
4114
|
+
* Returns a paginated, filterable view of stored memories. Superseded
|
|
4115
|
+
* versions are excluded. Use the returned `cursor` (when present) to
|
|
4116
|
+
* fetch the next page.
|
|
4117
|
+
*
|
|
4118
|
+
* @param options - Optional pagination and filter options.
|
|
4119
|
+
*/
|
|
4120
|
+
list(
|
|
4121
|
+
options?: AgentMemoryListMemoriesOptions,
|
|
4122
|
+
): Promise<AgentMemoryListMemoriesResult>;
|
|
4123
|
+
/**
|
|
4124
|
+
* Soft-delete every memory and message in this profile that is tagged
|
|
4125
|
+
* with `sessionId`.
|
|
4126
|
+
*
|
|
4127
|
+
* Idempotent: deleting a sessionId that has no rows is a no-op.
|
|
4128
|
+
*
|
|
4129
|
+
* @param sessionId - Session to delete.
|
|
4130
|
+
*/
|
|
4131
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
4132
|
+
}
|
|
4133
|
+
/**
|
|
4134
|
+
* Namespace-level Agent Memory binding.
|
|
4135
|
+
*
|
|
4136
|
+
* Used as the type of an `env.MEMORY`-style binding backed by the Agent
|
|
4137
|
+
* Memory product.
|
|
4138
|
+
*
|
|
4139
|
+
* @example
|
|
4140
|
+
* ```ts
|
|
4141
|
+
* export default {
|
|
4142
|
+
* async fetch(_request: Request, env: Env): Promise<Response> {
|
|
4143
|
+
* const profile = await env.MEMORY.getProfile("wrangler-e2e");
|
|
4144
|
+
* const summary = await profile.getSummary();
|
|
4145
|
+
* return Response.json(summary);
|
|
4146
|
+
* },
|
|
4147
|
+
* };
|
|
4148
|
+
* ```
|
|
4149
|
+
*/
|
|
4150
|
+
export declare abstract class AgentMemoryNamespace {
|
|
4151
|
+
/**
|
|
4152
|
+
* Get a memory profile by name. Profiles are isolated by namespace and
|
|
4153
|
+
* addressed by a compound key (namespaceId:profileName).
|
|
4154
|
+
*
|
|
4155
|
+
* @param profileName - Profile name (validated against naming rules).
|
|
4156
|
+
* @returns RPC target for interacting with the profile.
|
|
4157
|
+
*/
|
|
4158
|
+
getProfile(profileName: string): Promise<AgentMemoryProfile>;
|
|
4159
|
+
/**
|
|
4160
|
+
* Soft-delete a profile and schedule deferred purge. Marks all
|
|
4161
|
+
* memories and messages as deleted.
|
|
4162
|
+
*
|
|
4163
|
+
* @param profileName - Name of the profile to delete.
|
|
4164
|
+
*/
|
|
4165
|
+
deleteProfile(profileName: string): Promise<void>;
|
|
4166
|
+
}
|
|
3934
4167
|
// ============ AI Search Error Interfaces ============
|
|
3935
4168
|
export interface AiSearchInternalError extends Error {}
|
|
3936
4169
|
export interface AiSearchNotFoundError extends Error {}
|
|
@@ -12050,6 +12283,21 @@ export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformati
|
|
|
12050
12283
|
* (form a line).
|
|
12051
12284
|
*/
|
|
12052
12285
|
repeat?: true | "x" | "y";
|
|
12286
|
+
/**
|
|
12287
|
+
* How to combine the foreground and backdrop pixels to create the result
|
|
12288
|
+
*/
|
|
12289
|
+
composite?: /** Foreground drawn on top of backdrop (default) */
|
|
12290
|
+
| "over"
|
|
12291
|
+
/** Foreground shown only where backdrop is opaque */
|
|
12292
|
+
| "in"
|
|
12293
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
12294
|
+
| "atop"
|
|
12295
|
+
/** Foreground shown only where backdrop is transparent */
|
|
12296
|
+
| "out"
|
|
12297
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
12298
|
+
| "xor"
|
|
12299
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
12300
|
+
| "lighter";
|
|
12053
12301
|
/**
|
|
12054
12302
|
* Position of the overlay image relative to a given edge. Each property is
|
|
12055
12303
|
* an offset in pixels. 0 aligns exactly to the edge. For example, left: 10
|
|
@@ -13401,11 +13649,25 @@ export type ImageTransform = {
|
|
|
13401
13649
|
export type ImageDrawOptions = {
|
|
13402
13650
|
opacity?: number;
|
|
13403
13651
|
repeat?: boolean | string;
|
|
13652
|
+
composite?: ImageCompositeMode;
|
|
13404
13653
|
top?: number;
|
|
13405
13654
|
left?: number;
|
|
13406
13655
|
bottom?: number;
|
|
13407
13656
|
right?: number;
|
|
13408
13657
|
};
|
|
13658
|
+
export type ImageCompositeMode =
|
|
13659
|
+
/** Foreground drawn on top of backdrop (default) */
|
|
13660
|
+
| "over"
|
|
13661
|
+
/** Foreground shown only where backdrop is opaque */
|
|
13662
|
+
| "in"
|
|
13663
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
13664
|
+
| "atop"
|
|
13665
|
+
/** Foreground shown only where backdrop is transparent */
|
|
13666
|
+
| "out"
|
|
13667
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
13668
|
+
| "xor"
|
|
13669
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
13670
|
+
| "lighter";
|
|
13409
13671
|
export type ImageInputOptions = {
|
|
13410
13672
|
encoding?: "base64";
|
|
13411
13673
|
};
|