@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/experimental/index.d.ts
CHANGED
|
@@ -4734,6 +4734,239 @@ declare abstract class Span {
|
|
|
4734
4734
|
get isTraced(): boolean;
|
|
4735
4735
|
setAttribute(key: string, value?: boolean | number | string): void;
|
|
4736
4736
|
}
|
|
4737
|
+
// ============================================================================
|
|
4738
|
+
// Agent Memory
|
|
4739
|
+
//
|
|
4740
|
+
// Public type surface for user Workers binding to an Agent Memory namespace.
|
|
4741
|
+
// ============================================================================
|
|
4742
|
+
/** Memory type — every memory is classified into exactly one. */
|
|
4743
|
+
type AgentMemoryMemoryType = "fact" | "event" | "instruction" | "task";
|
|
4744
|
+
/** Search intensity for recall. */
|
|
4745
|
+
type AgentMemoryThinkingLevel = "low" | "medium" | "high";
|
|
4746
|
+
/** Response verbosity for recall. */
|
|
4747
|
+
type AgentMemoryResponseLength = "short" | "medium" | "long";
|
|
4748
|
+
/** A conversation message passed to ingest(). */
|
|
4749
|
+
interface AgentMemoryMessage {
|
|
4750
|
+
role: "system" | "user" | "assistant";
|
|
4751
|
+
content: string;
|
|
4752
|
+
/** Optional message timestamp. */
|
|
4753
|
+
timestamp?: Date;
|
|
4754
|
+
}
|
|
4755
|
+
/** Raw memory content passed to remember(). */
|
|
4756
|
+
interface AgentMemoryIncomingMemory {
|
|
4757
|
+
/** Raw memory content. The service classifies and summarizes automatically. */
|
|
4758
|
+
content: string;
|
|
4759
|
+
/** Optional session identifier to associate with this memory. */
|
|
4760
|
+
sessionId?: string | null | undefined;
|
|
4761
|
+
}
|
|
4762
|
+
/** A stored memory returned from remember(), get(), and delete(). */
|
|
4763
|
+
interface AgentMemoryMemory {
|
|
4764
|
+
/** Memory ID. */
|
|
4765
|
+
id: string;
|
|
4766
|
+
/** Memory type. */
|
|
4767
|
+
type: AgentMemoryMemoryType;
|
|
4768
|
+
/** Text summary. */
|
|
4769
|
+
summary: string;
|
|
4770
|
+
/** Memory text. */
|
|
4771
|
+
content: string;
|
|
4772
|
+
/** Session that created this memory. */
|
|
4773
|
+
sessionId: string | null;
|
|
4774
|
+
/** Memory creation time. */
|
|
4775
|
+
createdAt: Date;
|
|
4776
|
+
/** Memory last-update time. */
|
|
4777
|
+
updatedAt: Date;
|
|
4778
|
+
}
|
|
4779
|
+
/** Single entry in a list() response. Same shape as Memory minus full content. */
|
|
4780
|
+
type AgentMemoryMemoryListEntry = Omit<AgentMemoryMemory, "content">;
|
|
4781
|
+
/** A scored memory candidate in a recall result. */
|
|
4782
|
+
interface AgentMemoryScoredCandidate {
|
|
4783
|
+
/** Candidate ID. */
|
|
4784
|
+
id: string;
|
|
4785
|
+
/** Text summary. */
|
|
4786
|
+
summary: string;
|
|
4787
|
+
/** Session that created this candidate, when known. */
|
|
4788
|
+
sessionId: string | null;
|
|
4789
|
+
/** Relevance score (higher is better). Comparable only within a single query. */
|
|
4790
|
+
score: number;
|
|
4791
|
+
}
|
|
4792
|
+
/** Options for the ingest() method. */
|
|
4793
|
+
interface AgentMemoryIngestOptions {
|
|
4794
|
+
/** Session identifier to associate with memories created during ingestion. */
|
|
4795
|
+
sessionId?: string | null | undefined;
|
|
4796
|
+
}
|
|
4797
|
+
/** Options for the getSummary() method. */
|
|
4798
|
+
interface AgentMemoryGetSummaryOptions {
|
|
4799
|
+
/** Session identifier to retrieve session summary for. */
|
|
4800
|
+
sessionId?: string | null | undefined;
|
|
4801
|
+
}
|
|
4802
|
+
/** Response from the getSummary() method. */
|
|
4803
|
+
interface AgentMemoryGetSummaryResponse {
|
|
4804
|
+
/** Markdown summary. */
|
|
4805
|
+
summary: string;
|
|
4806
|
+
}
|
|
4807
|
+
/**
|
|
4808
|
+
* Options for the recall() method.
|
|
4809
|
+
*
|
|
4810
|
+
* `referenceDate` accepts a Date object, an ISO-8601 date string
|
|
4811
|
+
* (YYYY-MM-DD), or a full ISO-8601 datetime string. When provided, this
|
|
4812
|
+
* date is used as "today" for resolving relative time references
|
|
4813
|
+
* ("how many days ago", "last week") instead of the server's wall-clock time.
|
|
4814
|
+
*/
|
|
4815
|
+
interface AgentMemoryRecallOptions {
|
|
4816
|
+
/** Recall intensity: "low" (default), "medium", or "high". */
|
|
4817
|
+
thinkingLevel?: AgentMemoryThinkingLevel;
|
|
4818
|
+
/** Response verbosity: "short", "medium" (default), or "long". */
|
|
4819
|
+
responseLength?: AgentMemoryResponseLength;
|
|
4820
|
+
/** Temporal anchor for date arithmetic. */
|
|
4821
|
+
referenceDate?: Date | string;
|
|
4822
|
+
}
|
|
4823
|
+
/** Response from the recall() method. */
|
|
4824
|
+
interface AgentMemoryRecallResult {
|
|
4825
|
+
/** Number of memories retrieved. */
|
|
4826
|
+
count: number;
|
|
4827
|
+
/** LLM-generated answer synthesizing the matching memories. */
|
|
4828
|
+
answer: string;
|
|
4829
|
+
/** Matching memories ranked by relevance. */
|
|
4830
|
+
candidates: AgentMemoryScoredCandidate[];
|
|
4831
|
+
}
|
|
4832
|
+
/**
|
|
4833
|
+
* Options for the list() method.
|
|
4834
|
+
*
|
|
4835
|
+
* `cursor` is the opaque continuation token returned by the previous page;
|
|
4836
|
+
* pass it back unchanged to fetch the next page. `sessionId` and `type`
|
|
4837
|
+
* are exact-match filters; combining them is allowed.
|
|
4838
|
+
*/
|
|
4839
|
+
interface AgentMemoryListMemoriesOptions {
|
|
4840
|
+
/** Maximum number of memories to return. Default 20, max 500. */
|
|
4841
|
+
limit?: number;
|
|
4842
|
+
/** Opaque cursor from a previous page. */
|
|
4843
|
+
cursor?: string;
|
|
4844
|
+
/** Exact-match session filter. */
|
|
4845
|
+
sessionId?: string;
|
|
4846
|
+
/** Exact-match memory-type filter. */
|
|
4847
|
+
type?: AgentMemoryMemoryType;
|
|
4848
|
+
}
|
|
4849
|
+
/** Response from the list() method. */
|
|
4850
|
+
interface AgentMemoryListMemoriesResult {
|
|
4851
|
+
memories: AgentMemoryMemoryListEntry[];
|
|
4852
|
+
/** Continuation cursor; absent when this page exhausted the result set. */
|
|
4853
|
+
cursor?: string;
|
|
4854
|
+
}
|
|
4855
|
+
/**
|
|
4856
|
+
* A single Agent Memory profile, scoped to a profile name.
|
|
4857
|
+
*
|
|
4858
|
+
* Returned by {@link AgentMemoryNamespace.getProfile}.
|
|
4859
|
+
*/
|
|
4860
|
+
declare abstract class AgentMemoryProfile {
|
|
4861
|
+
/**
|
|
4862
|
+
* Retrieve a memory by ID.
|
|
4863
|
+
*
|
|
4864
|
+
* @param memoryId - ULID of the memory to retrieve.
|
|
4865
|
+
* @throws if the memory does not exist.
|
|
4866
|
+
*/
|
|
4867
|
+
get(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4868
|
+
/**
|
|
4869
|
+
* Delete a memory by ID.
|
|
4870
|
+
*
|
|
4871
|
+
* Removes the memory and any source messages linked by the memory's
|
|
4872
|
+
* source message IDs.
|
|
4873
|
+
*
|
|
4874
|
+
* @param memoryId - ULID of the memory to delete.
|
|
4875
|
+
* @throws if the memory does not exist.
|
|
4876
|
+
*/
|
|
4877
|
+
delete(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4878
|
+
/**
|
|
4879
|
+
* Store a memory in this profile. The content is automatically classified,
|
|
4880
|
+
* summarized, and indexed.
|
|
4881
|
+
*
|
|
4882
|
+
* @param memory - Raw memory content to persist.
|
|
4883
|
+
*/
|
|
4884
|
+
remember(memory: AgentMemoryIncomingMemory): Promise<AgentMemoryMemory>;
|
|
4885
|
+
/**
|
|
4886
|
+
* Extract memories from a conversation.
|
|
4887
|
+
*
|
|
4888
|
+
* @param messages - Conversation messages to extract memories from.
|
|
4889
|
+
* @param options - Optional ingest options.
|
|
4890
|
+
*/
|
|
4891
|
+
ingest(
|
|
4892
|
+
messages: Iterable<AgentMemoryMessage>,
|
|
4893
|
+
options?: AgentMemoryIngestOptions,
|
|
4894
|
+
): Promise<void>;
|
|
4895
|
+
/**
|
|
4896
|
+
* Get a profile summary.
|
|
4897
|
+
*
|
|
4898
|
+
* @param options - Optional getSummary options.
|
|
4899
|
+
*/
|
|
4900
|
+
getSummary(
|
|
4901
|
+
options?: AgentMemoryGetSummaryOptions,
|
|
4902
|
+
): Promise<AgentMemoryGetSummaryResponse>;
|
|
4903
|
+
/**
|
|
4904
|
+
* Recall memories in this profile.
|
|
4905
|
+
*
|
|
4906
|
+
* @param query - Recall query matched against memory content and keywords.
|
|
4907
|
+
* @param options - Optional recall parameters.
|
|
4908
|
+
* @returns Matching memories with relevance scores and a synthesized answer.
|
|
4909
|
+
*/
|
|
4910
|
+
recall(
|
|
4911
|
+
query: string,
|
|
4912
|
+
options?: AgentMemoryRecallOptions,
|
|
4913
|
+
): Promise<AgentMemoryRecallResult>;
|
|
4914
|
+
/**
|
|
4915
|
+
* List active memories in this profile.
|
|
4916
|
+
*
|
|
4917
|
+
* Returns a paginated, filterable view of stored memories. Superseded
|
|
4918
|
+
* versions are excluded. Use the returned `cursor` (when present) to
|
|
4919
|
+
* fetch the next page.
|
|
4920
|
+
*
|
|
4921
|
+
* @param options - Optional pagination and filter options.
|
|
4922
|
+
*/
|
|
4923
|
+
list(
|
|
4924
|
+
options?: AgentMemoryListMemoriesOptions,
|
|
4925
|
+
): Promise<AgentMemoryListMemoriesResult>;
|
|
4926
|
+
/**
|
|
4927
|
+
* Soft-delete every memory and message in this profile that is tagged
|
|
4928
|
+
* with `sessionId`.
|
|
4929
|
+
*
|
|
4930
|
+
* Idempotent: deleting a sessionId that has no rows is a no-op.
|
|
4931
|
+
*
|
|
4932
|
+
* @param sessionId - Session to delete.
|
|
4933
|
+
*/
|
|
4934
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
4935
|
+
}
|
|
4936
|
+
/**
|
|
4937
|
+
* Namespace-level Agent Memory binding.
|
|
4938
|
+
*
|
|
4939
|
+
* Used as the type of an `env.MEMORY`-style binding backed by the Agent
|
|
4940
|
+
* Memory product.
|
|
4941
|
+
*
|
|
4942
|
+
* @example
|
|
4943
|
+
* ```ts
|
|
4944
|
+
* export default {
|
|
4945
|
+
* async fetch(_request: Request, env: Env): Promise<Response> {
|
|
4946
|
+
* const profile = await env.MEMORY.getProfile("wrangler-e2e");
|
|
4947
|
+
* const summary = await profile.getSummary();
|
|
4948
|
+
* return Response.json(summary);
|
|
4949
|
+
* },
|
|
4950
|
+
* };
|
|
4951
|
+
* ```
|
|
4952
|
+
*/
|
|
4953
|
+
declare abstract class AgentMemoryNamespace {
|
|
4954
|
+
/**
|
|
4955
|
+
* Get a memory profile by name. Profiles are isolated by namespace and
|
|
4956
|
+
* addressed by a compound key (namespaceId:profileName).
|
|
4957
|
+
*
|
|
4958
|
+
* @param profileName - Profile name (validated against naming rules).
|
|
4959
|
+
* @returns RPC target for interacting with the profile.
|
|
4960
|
+
*/
|
|
4961
|
+
getProfile(profileName: string): Promise<AgentMemoryProfile>;
|
|
4962
|
+
/**
|
|
4963
|
+
* Soft-delete a profile and schedule deferred purge. Marks all
|
|
4964
|
+
* memories and messages as deleted.
|
|
4965
|
+
*
|
|
4966
|
+
* @param profileName - Name of the profile to delete.
|
|
4967
|
+
*/
|
|
4968
|
+
deleteProfile(profileName: string): Promise<void>;
|
|
4969
|
+
}
|
|
4737
4970
|
// ============ AI Search Error Interfaces ============
|
|
4738
4971
|
interface AiSearchInternalError extends Error {}
|
|
4739
4972
|
interface AiSearchNotFoundError extends Error {}
|
|
@@ -12847,6 +13080,21 @@ interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
|
|
|
12847
13080
|
* (form a line).
|
|
12848
13081
|
*/
|
|
12849
13082
|
repeat?: true | "x" | "y";
|
|
13083
|
+
/**
|
|
13084
|
+
* How to combine the foreground and backdrop pixels to create the result
|
|
13085
|
+
*/
|
|
13086
|
+
composite?: /** Foreground drawn on top of backdrop (default) */
|
|
13087
|
+
| "over"
|
|
13088
|
+
/** Foreground shown only where backdrop is opaque */
|
|
13089
|
+
| "in"
|
|
13090
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
13091
|
+
| "atop"
|
|
13092
|
+
/** Foreground shown only where backdrop is transparent */
|
|
13093
|
+
| "out"
|
|
13094
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
13095
|
+
| "xor"
|
|
13096
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
13097
|
+
| "lighter";
|
|
12850
13098
|
/**
|
|
12851
13099
|
* Position of the overlay image relative to a given edge. Each property is
|
|
12852
13100
|
* an offset in pixels. 0 aligns exactly to the edge. For example, left: 10
|
|
@@ -14190,11 +14438,25 @@ type ImageTransform = {
|
|
|
14190
14438
|
type ImageDrawOptions = {
|
|
14191
14439
|
opacity?: number;
|
|
14192
14440
|
repeat?: boolean | string;
|
|
14441
|
+
composite?: ImageCompositeMode;
|
|
14193
14442
|
top?: number;
|
|
14194
14443
|
left?: number;
|
|
14195
14444
|
bottom?: number;
|
|
14196
14445
|
right?: number;
|
|
14197
14446
|
};
|
|
14447
|
+
type ImageCompositeMode =
|
|
14448
|
+
/** Foreground drawn on top of backdrop (default) */
|
|
14449
|
+
| "over"
|
|
14450
|
+
/** Foreground shown only where backdrop is opaque */
|
|
14451
|
+
| "in"
|
|
14452
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
14453
|
+
| "atop"
|
|
14454
|
+
/** Foreground shown only where backdrop is transparent */
|
|
14455
|
+
| "out"
|
|
14456
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
14457
|
+
| "xor"
|
|
14458
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
14459
|
+
| "lighter";
|
|
14198
14460
|
type ImageInputOptions = {
|
|
14199
14461
|
encoding?: "base64";
|
|
14200
14462
|
};
|
package/experimental/index.ts
CHANGED
|
@@ -4740,6 +4740,239 @@ export declare abstract class Span {
|
|
|
4740
4740
|
get isTraced(): boolean;
|
|
4741
4741
|
setAttribute(key: string, value?: boolean | number | string): void;
|
|
4742
4742
|
}
|
|
4743
|
+
// ============================================================================
|
|
4744
|
+
// Agent Memory
|
|
4745
|
+
//
|
|
4746
|
+
// Public type surface for user Workers binding to an Agent Memory namespace.
|
|
4747
|
+
// ============================================================================
|
|
4748
|
+
/** Memory type — every memory is classified into exactly one. */
|
|
4749
|
+
export type AgentMemoryMemoryType = "fact" | "event" | "instruction" | "task";
|
|
4750
|
+
/** Search intensity for recall. */
|
|
4751
|
+
export type AgentMemoryThinkingLevel = "low" | "medium" | "high";
|
|
4752
|
+
/** Response verbosity for recall. */
|
|
4753
|
+
export type AgentMemoryResponseLength = "short" | "medium" | "long";
|
|
4754
|
+
/** A conversation message passed to ingest(). */
|
|
4755
|
+
export interface AgentMemoryMessage {
|
|
4756
|
+
role: "system" | "user" | "assistant";
|
|
4757
|
+
content: string;
|
|
4758
|
+
/** Optional message timestamp. */
|
|
4759
|
+
timestamp?: Date;
|
|
4760
|
+
}
|
|
4761
|
+
/** Raw memory content passed to remember(). */
|
|
4762
|
+
export interface AgentMemoryIncomingMemory {
|
|
4763
|
+
/** Raw memory content. The service classifies and summarizes automatically. */
|
|
4764
|
+
content: string;
|
|
4765
|
+
/** Optional session identifier to associate with this memory. */
|
|
4766
|
+
sessionId?: string | null | undefined;
|
|
4767
|
+
}
|
|
4768
|
+
/** A stored memory returned from remember(), get(), and delete(). */
|
|
4769
|
+
export interface AgentMemoryMemory {
|
|
4770
|
+
/** Memory ID. */
|
|
4771
|
+
id: string;
|
|
4772
|
+
/** Memory type. */
|
|
4773
|
+
type: AgentMemoryMemoryType;
|
|
4774
|
+
/** Text summary. */
|
|
4775
|
+
summary: string;
|
|
4776
|
+
/** Memory text. */
|
|
4777
|
+
content: string;
|
|
4778
|
+
/** Session that created this memory. */
|
|
4779
|
+
sessionId: string | null;
|
|
4780
|
+
/** Memory creation time. */
|
|
4781
|
+
createdAt: Date;
|
|
4782
|
+
/** Memory last-update time. */
|
|
4783
|
+
updatedAt: Date;
|
|
4784
|
+
}
|
|
4785
|
+
/** Single entry in a list() response. Same shape as Memory minus full content. */
|
|
4786
|
+
export type AgentMemoryMemoryListEntry = Omit<AgentMemoryMemory, "content">;
|
|
4787
|
+
/** A scored memory candidate in a recall result. */
|
|
4788
|
+
export interface AgentMemoryScoredCandidate {
|
|
4789
|
+
/** Candidate ID. */
|
|
4790
|
+
id: string;
|
|
4791
|
+
/** Text summary. */
|
|
4792
|
+
summary: string;
|
|
4793
|
+
/** Session that created this candidate, when known. */
|
|
4794
|
+
sessionId: string | null;
|
|
4795
|
+
/** Relevance score (higher is better). Comparable only within a single query. */
|
|
4796
|
+
score: number;
|
|
4797
|
+
}
|
|
4798
|
+
/** Options for the ingest() method. */
|
|
4799
|
+
export interface AgentMemoryIngestOptions {
|
|
4800
|
+
/** Session identifier to associate with memories created during ingestion. */
|
|
4801
|
+
sessionId?: string | null | undefined;
|
|
4802
|
+
}
|
|
4803
|
+
/** Options for the getSummary() method. */
|
|
4804
|
+
export interface AgentMemoryGetSummaryOptions {
|
|
4805
|
+
/** Session identifier to retrieve session summary for. */
|
|
4806
|
+
sessionId?: string | null | undefined;
|
|
4807
|
+
}
|
|
4808
|
+
/** Response from the getSummary() method. */
|
|
4809
|
+
export interface AgentMemoryGetSummaryResponse {
|
|
4810
|
+
/** Markdown summary. */
|
|
4811
|
+
summary: string;
|
|
4812
|
+
}
|
|
4813
|
+
/**
|
|
4814
|
+
* Options for the recall() method.
|
|
4815
|
+
*
|
|
4816
|
+
* `referenceDate` accepts a Date object, an ISO-8601 date string
|
|
4817
|
+
* (YYYY-MM-DD), or a full ISO-8601 datetime string. When provided, this
|
|
4818
|
+
* date is used as "today" for resolving relative time references
|
|
4819
|
+
* ("how many days ago", "last week") instead of the server's wall-clock time.
|
|
4820
|
+
*/
|
|
4821
|
+
export interface AgentMemoryRecallOptions {
|
|
4822
|
+
/** Recall intensity: "low" (default), "medium", or "high". */
|
|
4823
|
+
thinkingLevel?: AgentMemoryThinkingLevel;
|
|
4824
|
+
/** Response verbosity: "short", "medium" (default), or "long". */
|
|
4825
|
+
responseLength?: AgentMemoryResponseLength;
|
|
4826
|
+
/** Temporal anchor for date arithmetic. */
|
|
4827
|
+
referenceDate?: Date | string;
|
|
4828
|
+
}
|
|
4829
|
+
/** Response from the recall() method. */
|
|
4830
|
+
export interface AgentMemoryRecallResult {
|
|
4831
|
+
/** Number of memories retrieved. */
|
|
4832
|
+
count: number;
|
|
4833
|
+
/** LLM-generated answer synthesizing the matching memories. */
|
|
4834
|
+
answer: string;
|
|
4835
|
+
/** Matching memories ranked by relevance. */
|
|
4836
|
+
candidates: AgentMemoryScoredCandidate[];
|
|
4837
|
+
}
|
|
4838
|
+
/**
|
|
4839
|
+
* Options for the list() method.
|
|
4840
|
+
*
|
|
4841
|
+
* `cursor` is the opaque continuation token returned by the previous page;
|
|
4842
|
+
* pass it back unchanged to fetch the next page. `sessionId` and `type`
|
|
4843
|
+
* are exact-match filters; combining them is allowed.
|
|
4844
|
+
*/
|
|
4845
|
+
export interface AgentMemoryListMemoriesOptions {
|
|
4846
|
+
/** Maximum number of memories to return. Default 20, max 500. */
|
|
4847
|
+
limit?: number;
|
|
4848
|
+
/** Opaque cursor from a previous page. */
|
|
4849
|
+
cursor?: string;
|
|
4850
|
+
/** Exact-match session filter. */
|
|
4851
|
+
sessionId?: string;
|
|
4852
|
+
/** Exact-match memory-type filter. */
|
|
4853
|
+
type?: AgentMemoryMemoryType;
|
|
4854
|
+
}
|
|
4855
|
+
/** Response from the list() method. */
|
|
4856
|
+
export interface AgentMemoryListMemoriesResult {
|
|
4857
|
+
memories: AgentMemoryMemoryListEntry[];
|
|
4858
|
+
/** Continuation cursor; absent when this page exhausted the result set. */
|
|
4859
|
+
cursor?: string;
|
|
4860
|
+
}
|
|
4861
|
+
/**
|
|
4862
|
+
* A single Agent Memory profile, scoped to a profile name.
|
|
4863
|
+
*
|
|
4864
|
+
* Returned by {@link AgentMemoryNamespace.getProfile}.
|
|
4865
|
+
*/
|
|
4866
|
+
export declare abstract class AgentMemoryProfile {
|
|
4867
|
+
/**
|
|
4868
|
+
* Retrieve a memory by ID.
|
|
4869
|
+
*
|
|
4870
|
+
* @param memoryId - ULID of the memory to retrieve.
|
|
4871
|
+
* @throws if the memory does not exist.
|
|
4872
|
+
*/
|
|
4873
|
+
get(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4874
|
+
/**
|
|
4875
|
+
* Delete a memory by ID.
|
|
4876
|
+
*
|
|
4877
|
+
* Removes the memory and any source messages linked by the memory's
|
|
4878
|
+
* source message IDs.
|
|
4879
|
+
*
|
|
4880
|
+
* @param memoryId - ULID of the memory to delete.
|
|
4881
|
+
* @throws if the memory does not exist.
|
|
4882
|
+
*/
|
|
4883
|
+
delete(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4884
|
+
/**
|
|
4885
|
+
* Store a memory in this profile. The content is automatically classified,
|
|
4886
|
+
* summarized, and indexed.
|
|
4887
|
+
*
|
|
4888
|
+
* @param memory - Raw memory content to persist.
|
|
4889
|
+
*/
|
|
4890
|
+
remember(memory: AgentMemoryIncomingMemory): Promise<AgentMemoryMemory>;
|
|
4891
|
+
/**
|
|
4892
|
+
* Extract memories from a conversation.
|
|
4893
|
+
*
|
|
4894
|
+
* @param messages - Conversation messages to extract memories from.
|
|
4895
|
+
* @param options - Optional ingest options.
|
|
4896
|
+
*/
|
|
4897
|
+
ingest(
|
|
4898
|
+
messages: Iterable<AgentMemoryMessage>,
|
|
4899
|
+
options?: AgentMemoryIngestOptions,
|
|
4900
|
+
): Promise<void>;
|
|
4901
|
+
/**
|
|
4902
|
+
* Get a profile summary.
|
|
4903
|
+
*
|
|
4904
|
+
* @param options - Optional getSummary options.
|
|
4905
|
+
*/
|
|
4906
|
+
getSummary(
|
|
4907
|
+
options?: AgentMemoryGetSummaryOptions,
|
|
4908
|
+
): Promise<AgentMemoryGetSummaryResponse>;
|
|
4909
|
+
/**
|
|
4910
|
+
* Recall memories in this profile.
|
|
4911
|
+
*
|
|
4912
|
+
* @param query - Recall query matched against memory content and keywords.
|
|
4913
|
+
* @param options - Optional recall parameters.
|
|
4914
|
+
* @returns Matching memories with relevance scores and a synthesized answer.
|
|
4915
|
+
*/
|
|
4916
|
+
recall(
|
|
4917
|
+
query: string,
|
|
4918
|
+
options?: AgentMemoryRecallOptions,
|
|
4919
|
+
): Promise<AgentMemoryRecallResult>;
|
|
4920
|
+
/**
|
|
4921
|
+
* List active memories in this profile.
|
|
4922
|
+
*
|
|
4923
|
+
* Returns a paginated, filterable view of stored memories. Superseded
|
|
4924
|
+
* versions are excluded. Use the returned `cursor` (when present) to
|
|
4925
|
+
* fetch the next page.
|
|
4926
|
+
*
|
|
4927
|
+
* @param options - Optional pagination and filter options.
|
|
4928
|
+
*/
|
|
4929
|
+
list(
|
|
4930
|
+
options?: AgentMemoryListMemoriesOptions,
|
|
4931
|
+
): Promise<AgentMemoryListMemoriesResult>;
|
|
4932
|
+
/**
|
|
4933
|
+
* Soft-delete every memory and message in this profile that is tagged
|
|
4934
|
+
* with `sessionId`.
|
|
4935
|
+
*
|
|
4936
|
+
* Idempotent: deleting a sessionId that has no rows is a no-op.
|
|
4937
|
+
*
|
|
4938
|
+
* @param sessionId - Session to delete.
|
|
4939
|
+
*/
|
|
4940
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
4941
|
+
}
|
|
4942
|
+
/**
|
|
4943
|
+
* Namespace-level Agent Memory binding.
|
|
4944
|
+
*
|
|
4945
|
+
* Used as the type of an `env.MEMORY`-style binding backed by the Agent
|
|
4946
|
+
* Memory product.
|
|
4947
|
+
*
|
|
4948
|
+
* @example
|
|
4949
|
+
* ```ts
|
|
4950
|
+
* export default {
|
|
4951
|
+
* async fetch(_request: Request, env: Env): Promise<Response> {
|
|
4952
|
+
* const profile = await env.MEMORY.getProfile("wrangler-e2e");
|
|
4953
|
+
* const summary = await profile.getSummary();
|
|
4954
|
+
* return Response.json(summary);
|
|
4955
|
+
* },
|
|
4956
|
+
* };
|
|
4957
|
+
* ```
|
|
4958
|
+
*/
|
|
4959
|
+
export declare abstract class AgentMemoryNamespace {
|
|
4960
|
+
/**
|
|
4961
|
+
* Get a memory profile by name. Profiles are isolated by namespace and
|
|
4962
|
+
* addressed by a compound key (namespaceId:profileName).
|
|
4963
|
+
*
|
|
4964
|
+
* @param profileName - Profile name (validated against naming rules).
|
|
4965
|
+
* @returns RPC target for interacting with the profile.
|
|
4966
|
+
*/
|
|
4967
|
+
getProfile(profileName: string): Promise<AgentMemoryProfile>;
|
|
4968
|
+
/**
|
|
4969
|
+
* Soft-delete a profile and schedule deferred purge. Marks all
|
|
4970
|
+
* memories and messages as deleted.
|
|
4971
|
+
*
|
|
4972
|
+
* @param profileName - Name of the profile to delete.
|
|
4973
|
+
*/
|
|
4974
|
+
deleteProfile(profileName: string): Promise<void>;
|
|
4975
|
+
}
|
|
4743
4976
|
// ============ AI Search Error Interfaces ============
|
|
4744
4977
|
export interface AiSearchInternalError extends Error {}
|
|
4745
4978
|
export interface AiSearchNotFoundError extends Error {}
|
|
@@ -12859,6 +13092,21 @@ export interface RequestInitCfPropertiesImageDraw extends BasicImageTransformati
|
|
|
12859
13092
|
* (form a line).
|
|
12860
13093
|
*/
|
|
12861
13094
|
repeat?: true | "x" | "y";
|
|
13095
|
+
/**
|
|
13096
|
+
* How to combine the foreground and backdrop pixels to create the result
|
|
13097
|
+
*/
|
|
13098
|
+
composite?: /** Foreground drawn on top of backdrop (default) */
|
|
13099
|
+
| "over"
|
|
13100
|
+
/** Foreground shown only where backdrop is opaque */
|
|
13101
|
+
| "in"
|
|
13102
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
13103
|
+
| "atop"
|
|
13104
|
+
/** Foreground shown only where backdrop is transparent */
|
|
13105
|
+
| "out"
|
|
13106
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
13107
|
+
| "xor"
|
|
13108
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
13109
|
+
| "lighter";
|
|
12862
13110
|
/**
|
|
12863
13111
|
* Position of the overlay image relative to a given edge. Each property is
|
|
12864
13112
|
* an offset in pixels. 0 aligns exactly to the edge. For example, left: 10
|
|
@@ -14210,11 +14458,25 @@ export type ImageTransform = {
|
|
|
14210
14458
|
export type ImageDrawOptions = {
|
|
14211
14459
|
opacity?: number;
|
|
14212
14460
|
repeat?: boolean | string;
|
|
14461
|
+
composite?: ImageCompositeMode;
|
|
14213
14462
|
top?: number;
|
|
14214
14463
|
left?: number;
|
|
14215
14464
|
bottom?: number;
|
|
14216
14465
|
right?: number;
|
|
14217
14466
|
};
|
|
14467
|
+
export type ImageCompositeMode =
|
|
14468
|
+
/** Foreground drawn on top of backdrop (default) */
|
|
14469
|
+
| "over"
|
|
14470
|
+
/** Foreground shown only where backdrop is opaque */
|
|
14471
|
+
| "in"
|
|
14472
|
+
/** Foreground drawn on top, but clipped to the backdrop's shape */
|
|
14473
|
+
| "atop"
|
|
14474
|
+
/** Foreground shown only where backdrop is transparent */
|
|
14475
|
+
| "out"
|
|
14476
|
+
/** Foreground and backdrop visible only where the other is not */
|
|
14477
|
+
| "xor"
|
|
14478
|
+
/** Foreground and backdrop channels added (brightening) */
|
|
14479
|
+
| "lighter";
|
|
14218
14480
|
export type ImageInputOptions = {
|
|
14219
14481
|
encoding?: "base64";
|
|
14220
14482
|
};
|