@openvtc/trust-tasks 0.28.23 → 0.28.25
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/CHANGELOG.md +85 -0
- package/dist/_shared/components.d.ts +520 -0
- package/dist/_shared/components.d.ts.map +1 -1
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -1
- package/dist/messaging/mux/_shared/0.1/mux.d.ts +16 -0
- package/dist/messaging/mux/_shared/0.1/mux.d.ts.map +1 -0
- package/dist/messaging/mux/_shared/0.1/mux.js +6 -0
- package/dist/messaging/mux/_shared/0.1/mux.js.map +1 -0
- package/dist/messaging/mux/attach/0.1/payload.d.ts +996 -0
- package/dist/messaging/mux/attach/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/attach/0.1/payload.js +594 -0
- package/dist/messaging/mux/attach/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/detach/0.1/payload.d.ts +398 -0
- package/dist/messaging/mux/detach/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/detach/0.1/payload.js +215 -0
- package/dist/messaging/mux/detach/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/event/0.1/payload.d.ts +513 -0
- package/dist/messaging/mux/event/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/event/0.1/payload.js +260 -0
- package/dist/messaging/mux/event/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/grant/0.1/payload.d.ts +1008 -0
- package/dist/messaging/mux/grant/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/grant/0.1/payload.js +606 -0
- package/dist/messaging/mux/grant/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/list/0.1/payload.d.ts +1241 -0
- package/dist/messaging/mux/list/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/list/0.1/payload.js +715 -0
- package/dist/messaging/mux/list/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/notice/0.1/payload.d.ts +489 -0
- package/dist/messaging/mux/notice/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/notice/0.1/payload.js +249 -0
- package/dist/messaging/mux/notice/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/revoke/0.1/payload.d.ts +585 -0
- package/dist/messaging/mux/revoke/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/revoke/0.1/payload.js +311 -0
- package/dist/messaging/mux/revoke/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.d.ts +682 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.js +397 -0
- package/dist/messaging/mux/revoke-all/0.1/payload.js.map +1 -0
- package/dist/messaging/mux/update/0.1/payload.d.ts +995 -0
- package/dist/messaging/mux/update/0.1/payload.d.ts.map +1 -0
- package/dist/messaging/mux/update/0.1/payload.js +586 -0
- package/dist/messaging/mux/update/0.1/payload.js.map +1 -0
- package/dist/vta/_shared/0.1/memory-record.d.ts +22 -0
- package/dist/vta/_shared/0.1/memory-record.d.ts.map +1 -0
- package/dist/vta/_shared/0.1/memory-record.js +6 -0
- package/dist/vta/_shared/0.1/memory-record.js.map +1 -0
- package/dist/vta/memory/delete/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/delete/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/delete/0.1/payload.js +1 -1
- package/dist/vta/memory/delete/0.1/payload.js.map +1 -1
- package/dist/vta/memory/delete/0.2/payload.d.ts +415 -0
- package/dist/vta/memory/delete/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/delete/0.2/payload.js +224 -0
- package/dist/vta/memory/delete/0.2/payload.js.map +1 -0
- package/dist/vta/memory/get/0.1/payload.d.ts +646 -0
- package/dist/vta/memory/get/0.1/payload.d.ts.map +1 -0
- package/dist/vta/memory/get/0.1/payload.js +349 -0
- package/dist/vta/memory/get/0.1/payload.js.map +1 -0
- package/dist/vta/memory/list/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/list/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/list/0.1/payload.js +1 -1
- package/dist/vta/memory/list/0.1/payload.js.map +1 -1
- package/dist/vta/memory/list/0.2/payload.d.ts +693 -0
- package/dist/vta/memory/list/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/list/0.2/payload.js +363 -0
- package/dist/vta/memory/list/0.2/payload.js.map +1 -0
- package/dist/vta/memory/put/0.1/payload.d.ts +13 -2
- package/dist/vta/memory/put/0.1/payload.d.ts.map +1 -1
- package/dist/vta/memory/put/0.1/payload.js +1 -1
- package/dist/vta/memory/put/0.1/payload.js.map +1 -1
- package/dist/vta/memory/put/0.2/payload.d.ts +490 -0
- package/dist/vta/memory/put/0.2/payload.d.ts.map +1 -0
- package/dist/vta/memory/put/0.2/payload.js +264 -0
- package/dist/vta/memory/put/0.2/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_shared/components.ts +581 -0
- package/src/index.ts +45 -0
- package/src/messaging/mux/_shared/0.1/mux.ts +17 -0
- package/src/messaging/mux/attach/0.1/payload.ts +682 -0
- package/src/messaging/mux/detach/0.1/payload.ts +278 -0
- package/src/messaging/mux/event/0.1/payload.ts +371 -0
- package/src/messaging/mux/grant/0.1/payload.ts +710 -0
- package/src/messaging/mux/list/0.1/payload.ts +793 -0
- package/src/messaging/mux/notice/0.1/payload.ts +362 -0
- package/src/messaging/mux/revoke/0.1/payload.ts +389 -0
- package/src/messaging/mux/revoke-all/0.1/payload.ts +452 -0
- package/src/messaging/mux/update/0.1/payload.ts +644 -0
- package/src/vta/_shared/0.1/memory-record.ts +23 -0
- package/src/vta/memory/delete/0.1/payload.ts +14 -3
- package/src/vta/memory/delete/0.2/payload.ts +288 -0
- package/src/vta/memory/get/0.1/payload.ts +414 -0
- package/src/vta/memory/list/0.1/payload.ts +14 -3
- package/src/vta/memory/list/0.2/payload.ts +445 -0
- package/src/vta/memory/put/0.1/payload.ts +14 -3
- package/src/vta/memory/put/0.2/payload.ts +333 -0
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vta/memory/list/0.2/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
import type { Ext, MemoryKey, MemoryRecord, MemoryValue, MemoryVersion } from "../../../../_shared/components.js";
|
|
6
|
+
/**
|
|
7
|
+
* Enumerate the memory items in a context. Two modes, distinguished by whether `sinceVersion` is supplied. Without it this is a SNAPSHOT of live items, optionally narrowed by `prefix`. With it this is a CHANGE FEED: every item in the context whose version exceeds the watermark, tombstones included, which is what lets an agent's local cache on another device converge. Pagination is opaque-cursor based.
|
|
8
|
+
*/
|
|
9
|
+
export interface VTAMemoryListPayload {
|
|
10
|
+
/**
|
|
11
|
+
* The VTA context to enumerate; the isolation boundary.
|
|
12
|
+
*/
|
|
13
|
+
contextId: string;
|
|
14
|
+
/**
|
|
15
|
+
* Restrict to items whose `key` begins with this byte prefix, compared over the UTF-8 encoding. Lets an agent recall one family of items — `contact/`, `preference/` — without dragging the whole context through the response.
|
|
16
|
+
*/
|
|
17
|
+
prefix?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Watermark. Selects change-feed mode: only items whose `version` is strictly greater are returned, tombstones included. Supply the `highWatermark` from the previous sync, or 0 for a first full pull in change-feed form.
|
|
20
|
+
*/
|
|
21
|
+
sinceVersion?: number;
|
|
22
|
+
/**
|
|
23
|
+
* When true, each returned item carries its `value`. Defaults to TRUE — unlike vta/app-state/list — because recalling the text is what an agent lists memory for, and 0.1 always returned values. Set it false for the metadata view (key, version, timestamps, `valueBytes`), which makes a scan of a large context cheap.
|
|
24
|
+
*/
|
|
25
|
+
includeValues?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Snapshot mode only: when true, tombstones still inside the retention window are returned alongside live items. Defaults to false. In change-feed mode tombstones are always returned and this member MUST NOT be set to false — a change feed that omits deletions cannot converge.
|
|
28
|
+
*/
|
|
29
|
+
includeDeleted?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* An opaque continuation token from a previous response's `nextCursor`; a responder MUST NOT accept a cursor it did not issue. Consumers MUST treat it as opaque: never construct, decode, mutate, or infer meaning from one.
|
|
32
|
+
*/
|
|
33
|
+
cursor?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The most items to return; the responder chooses a default and MAY return fewer, which is likely when `includeValues` is in effect and the values are large.
|
|
36
|
+
*/
|
|
37
|
+
limit?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
40
|
+
*/
|
|
41
|
+
ext?: Ext;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Success response to vta/memory/list. Type https://trusttasks.org/spec/vta/memory/list/0.2#response.
|
|
45
|
+
*/
|
|
46
|
+
export interface VTAMemoryListResponsePayload {
|
|
47
|
+
/**
|
|
48
|
+
* Matching items in ascending key order in snapshot mode, and ascending version order in change-feed mode — the latter so that a consumer applying them in order reaches the same state as the maintainer. May be empty.
|
|
49
|
+
*/
|
|
50
|
+
items: MemoryRecord[];
|
|
51
|
+
/**
|
|
52
|
+
* Opaque continuation token for the next page, sent back as the request's `cursor`. Present when more matching items exist beyond this page; absent on the last page.
|
|
53
|
+
*/
|
|
54
|
+
nextCursor?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The context's current counter value; 0 for a context that has never been written. This is what a consumer stores as its next `sinceVersion` — NOT the maximum version among `items`, which is wrong whenever a `prefix` filtered a later change out, and undefined when the page is empty. A paginating consumer MUST NOT advance its stored watermark until it has drained the final page — the one with no `nextCursor` — because the pages of one feed share this value and adopting it early would skip the items still to come.
|
|
57
|
+
*/
|
|
58
|
+
highWatermark: number;
|
|
59
|
+
/**
|
|
60
|
+
* How long this maintainer retains tombstones before reaping them. Advisory, so a consumer can schedule its syncs to stay inside the window rather than discovering it has fallen out of it via vta/memory/list:watermarkTooOld.
|
|
61
|
+
*/
|
|
62
|
+
tombstoneRetentionSeconds?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Ecosystem-defined extension members per SPEC.md §4.5.1.
|
|
65
|
+
*/
|
|
66
|
+
ext?: Ext;
|
|
67
|
+
}
|
|
68
|
+
/** Shared definitions this specification references, re-exported under the names it used to declare them with. */
|
|
69
|
+
export type { Ext, MemoryKey, MemoryRecord, MemoryValue, MemoryVersion };
|
|
70
|
+
/** Trust Task type URI. */
|
|
71
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/vta/memory/list/0.2";
|
|
72
|
+
/**
|
|
73
|
+
* The earlier version of this specification that this one declares it
|
|
74
|
+
* extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
|
|
75
|
+
* `null`. Only the direct declaration — follow the chain with
|
|
76
|
+
* `extendsChain` / `readForSpec`.
|
|
77
|
+
*/
|
|
78
|
+
export declare const EXTENDS: string | null;
|
|
79
|
+
/**
|
|
80
|
+
* Why this version is deprecated, or `null` while it is current. A
|
|
81
|
+
* superseded or retired version is still supported, and is withdrawn from
|
|
82
|
+
* this package in a later scheduled batch (SPEC "Superseded and Withdrawn
|
|
83
|
+
* Versions").
|
|
84
|
+
*/
|
|
85
|
+
export declare const DEPRECATION: string | null;
|
|
86
|
+
/** Stable alias for this specification's request payload shape. */
|
|
87
|
+
export type Payload = VTAMemoryListPayload;
|
|
88
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
89
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vta/memory/list/0.2#response";
|
|
90
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
91
|
+
export type Response = VTAMemoryListResponsePayload;
|
|
92
|
+
/**
|
|
93
|
+
* This specification's payload schema, as a value.
|
|
94
|
+
*
|
|
95
|
+
* SPEC.md §7.2 item 2 is performed against this. It is shipped as data
|
|
96
|
+
* rather than only as a `.json` file because TypeScript types are erased
|
|
97
|
+
* at runtime: without a schema a consumer has nothing to validate, and
|
|
98
|
+
* every REQUIRED payload member is optional in practice. Cross-file
|
|
99
|
+
* `$ref`s are already inlined, so it needs no resolver.
|
|
100
|
+
*/
|
|
101
|
+
export declare const PAYLOAD_SCHEMA: {
|
|
102
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
103
|
+
readonly $id: "https://trusttasks.org/spec/vta/memory/list/0.2";
|
|
104
|
+
readonly title: "VTA Memory List — payload";
|
|
105
|
+
readonly description: "Enumerate the memory items in a context. Two modes, distinguished by whether `sinceVersion` is supplied. Without it this is a SNAPSHOT of live items, optionally narrowed by `prefix`. With it this is a CHANGE FEED: every item in the context whose version exceeds the watermark, tombstones included, which is what lets an agent's local cache on another device converge. Pagination is opaque-cursor based.";
|
|
106
|
+
readonly type: "object";
|
|
107
|
+
readonly additionalProperties: false;
|
|
108
|
+
readonly required: readonly ["contextId"];
|
|
109
|
+
readonly properties: {
|
|
110
|
+
readonly contextId: {
|
|
111
|
+
readonly type: "string";
|
|
112
|
+
readonly minLength: 1;
|
|
113
|
+
readonly description: "The VTA context to enumerate; the isolation boundary.";
|
|
114
|
+
};
|
|
115
|
+
readonly prefix: {
|
|
116
|
+
readonly type: "string";
|
|
117
|
+
readonly minLength: 1;
|
|
118
|
+
readonly maxLength: 512;
|
|
119
|
+
readonly description: "Restrict to items whose `key` begins with this byte prefix, compared over the UTF-8 encoding. Lets an agent recall one family of items — `contact/`, `preference/` — without dragging the whole context through the response.";
|
|
120
|
+
};
|
|
121
|
+
readonly sinceVersion: {
|
|
122
|
+
readonly type: "integer";
|
|
123
|
+
readonly minimum: 0;
|
|
124
|
+
readonly description: "Watermark. Selects change-feed mode: only items whose `version` is strictly greater are returned, tombstones included. Supply the `highWatermark` from the previous sync, or 0 for a first full pull in change-feed form.";
|
|
125
|
+
};
|
|
126
|
+
readonly includeValues: {
|
|
127
|
+
readonly type: "boolean";
|
|
128
|
+
readonly description: "When true, each returned item carries its `value`. Defaults to TRUE — unlike vta/app-state/list — because recalling the text is what an agent lists memory for, and 0.1 always returned values. Set it false for the metadata view (key, version, timestamps, `valueBytes`), which makes a scan of a large context cheap.";
|
|
129
|
+
};
|
|
130
|
+
readonly includeDeleted: {
|
|
131
|
+
readonly type: "boolean";
|
|
132
|
+
readonly description: "Snapshot mode only: when true, tombstones still inside the retention window are returned alongside live items. Defaults to false. In change-feed mode tombstones are always returned and this member MUST NOT be set to false — a change feed that omits deletions cannot converge.";
|
|
133
|
+
};
|
|
134
|
+
readonly cursor: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly description: "An opaque continuation token from a previous response's `nextCursor`; a responder MUST NOT accept a cursor it did not issue. Consumers MUST treat it as opaque: never construct, decode, mutate, or infer meaning from one.";
|
|
137
|
+
};
|
|
138
|
+
readonly limit: {
|
|
139
|
+
readonly type: "integer";
|
|
140
|
+
readonly minimum: 1;
|
|
141
|
+
readonly maximum: 1000;
|
|
142
|
+
readonly description: "The most items to return; the responder chooses a default and MAY return fewer, which is likely when `includeValues` is in effect and the values are large.";
|
|
143
|
+
};
|
|
144
|
+
readonly ext: {
|
|
145
|
+
readonly $ref: "#/$defs/Ext";
|
|
146
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
readonly $defs: {
|
|
150
|
+
readonly Response: {
|
|
151
|
+
readonly $anchor: "response";
|
|
152
|
+
readonly title: "VTA Memory List — response payload";
|
|
153
|
+
readonly description: "Success response to vta/memory/list. Type https://trusttasks.org/spec/vta/memory/list/0.2#response.";
|
|
154
|
+
readonly type: "object";
|
|
155
|
+
readonly additionalProperties: false;
|
|
156
|
+
readonly required: readonly ["items", "highWatermark"];
|
|
157
|
+
readonly properties: {
|
|
158
|
+
readonly items: {
|
|
159
|
+
readonly type: "array";
|
|
160
|
+
readonly items: {
|
|
161
|
+
readonly $ref: "#/$defs/MemoryRecord";
|
|
162
|
+
};
|
|
163
|
+
readonly description: "Matching items in ascending key order in snapshot mode, and ascending version order in change-feed mode — the latter so that a consumer applying them in order reaches the same state as the maintainer. May be empty.";
|
|
164
|
+
};
|
|
165
|
+
readonly nextCursor: {
|
|
166
|
+
readonly type: "string";
|
|
167
|
+
readonly description: "Opaque continuation token for the next page, sent back as the request's `cursor`. Present when more matching items exist beyond this page; absent on the last page.";
|
|
168
|
+
};
|
|
169
|
+
readonly highWatermark: {
|
|
170
|
+
readonly type: "integer";
|
|
171
|
+
readonly minimum: 0;
|
|
172
|
+
readonly description: "The context's current counter value; 0 for a context that has never been written. This is what a consumer stores as its next `sinceVersion` — NOT the maximum version among `items`, which is wrong whenever a `prefix` filtered a later change out, and undefined when the page is empty. A paginating consumer MUST NOT advance its stored watermark until it has drained the final page — the one with no `nextCursor` — because the pages of one feed share this value and adopting it early would skip the items still to come.";
|
|
173
|
+
};
|
|
174
|
+
readonly tombstoneRetentionSeconds: {
|
|
175
|
+
readonly type: "integer";
|
|
176
|
+
readonly minimum: 0;
|
|
177
|
+
readonly description: "How long this maintainer retains tombstones before reaping them. Advisory, so a consumer can schedule its syncs to stay inside the window rather than discovering it has fallen out of it via vta/memory/list:watermarkTooOld.";
|
|
178
|
+
};
|
|
179
|
+
readonly ext: {
|
|
180
|
+
readonly $ref: "#/$defs/Ext";
|
|
181
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
readonly Ext: {
|
|
186
|
+
readonly title: "Ext";
|
|
187
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
188
|
+
readonly type: "object";
|
|
189
|
+
readonly minProperties: 1;
|
|
190
|
+
readonly additionalProperties: true;
|
|
191
|
+
readonly propertyNames: {
|
|
192
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
readonly MemoryRecord: {
|
|
196
|
+
readonly title: "MemoryRecord";
|
|
197
|
+
readonly description: "A memory item as the maintainer holds it. `value` is absent in two distinct situations and a consumer MUST NOT conflate them: the item is a tombstone (`deleted` is true), or the caller asked for a metadata-only view (`vta/memory/list` without `includeValues`). This is why `deleted` is required rather than defaulted — a consumer that infers deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
198
|
+
readonly type: "object";
|
|
199
|
+
readonly additionalProperties: false;
|
|
200
|
+
readonly required: readonly ["contextId", "key", "version", "deleted", "updatedAt"];
|
|
201
|
+
readonly properties: {
|
|
202
|
+
readonly contextId: {
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
readonly minLength: 1;
|
|
205
|
+
readonly description: "The VTA context the item is scoped to; the isolation boundary.";
|
|
206
|
+
};
|
|
207
|
+
readonly key: {
|
|
208
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
209
|
+
};
|
|
210
|
+
readonly version: {
|
|
211
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
212
|
+
readonly description: "The context counter value this item's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
213
|
+
};
|
|
214
|
+
readonly value: {
|
|
215
|
+
readonly $ref: "#/$defs/MemoryValue";
|
|
216
|
+
readonly description: "The remembered text. Absent when this is a tombstone or a metadata-only view.";
|
|
217
|
+
};
|
|
218
|
+
readonly valueBytes: {
|
|
219
|
+
readonly type: "integer";
|
|
220
|
+
readonly minimum: 0;
|
|
221
|
+
readonly description: "Size of the stored value in bytes over its UTF-8 encoding, as the maintainer measures it for the per-item cap. Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
222
|
+
};
|
|
223
|
+
readonly deleted: {
|
|
224
|
+
readonly type: "boolean";
|
|
225
|
+
readonly description: "True when this is a tombstone: the item was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/memory/list`.";
|
|
226
|
+
};
|
|
227
|
+
readonly createdAt: {
|
|
228
|
+
readonly type: "string";
|
|
229
|
+
readonly format: "date-time";
|
|
230
|
+
readonly description: "When the item was first created at this key. MAY be absent on a tombstone whose body has been discarded, and on an item written before the maintainer kept versions.";
|
|
231
|
+
};
|
|
232
|
+
readonly updatedAt: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
readonly format: "date-time";
|
|
235
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
236
|
+
};
|
|
237
|
+
readonly deletedAt: {
|
|
238
|
+
readonly type: "string";
|
|
239
|
+
readonly format: "date-time";
|
|
240
|
+
readonly description: "When the item was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
readonly MemoryValue: {
|
|
245
|
+
readonly title: "MemoryValue";
|
|
246
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
247
|
+
readonly type: "string";
|
|
248
|
+
};
|
|
249
|
+
readonly MemoryVersion: {
|
|
250
|
+
readonly title: "MemoryVersion";
|
|
251
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
252
|
+
readonly type: "integer";
|
|
253
|
+
readonly minimum: 1;
|
|
254
|
+
};
|
|
255
|
+
readonly MemoryKey: {
|
|
256
|
+
readonly title: "MemoryKey";
|
|
257
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
258
|
+
readonly type: "string";
|
|
259
|
+
readonly minLength: 1;
|
|
260
|
+
readonly maxLength: 512;
|
|
261
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
/** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
|
|
266
|
+
export declare const RESPONSE_PAYLOAD_SCHEMA: {
|
|
267
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
268
|
+
readonly $ref: "#/$defs/Response";
|
|
269
|
+
readonly $defs: {
|
|
270
|
+
readonly Response: {
|
|
271
|
+
readonly $anchor: "response";
|
|
272
|
+
readonly title: "VTA Memory List — response payload";
|
|
273
|
+
readonly description: "Success response to vta/memory/list. Type https://trusttasks.org/spec/vta/memory/list/0.2#response.";
|
|
274
|
+
readonly type: "object";
|
|
275
|
+
readonly additionalProperties: false;
|
|
276
|
+
readonly required: readonly ["items", "highWatermark"];
|
|
277
|
+
readonly properties: {
|
|
278
|
+
readonly items: {
|
|
279
|
+
readonly type: "array";
|
|
280
|
+
readonly items: {
|
|
281
|
+
readonly $ref: "#/$defs/MemoryRecord";
|
|
282
|
+
};
|
|
283
|
+
readonly description: "Matching items in ascending key order in snapshot mode, and ascending version order in change-feed mode — the latter so that a consumer applying them in order reaches the same state as the maintainer. May be empty.";
|
|
284
|
+
};
|
|
285
|
+
readonly nextCursor: {
|
|
286
|
+
readonly type: "string";
|
|
287
|
+
readonly description: "Opaque continuation token for the next page, sent back as the request's `cursor`. Present when more matching items exist beyond this page; absent on the last page.";
|
|
288
|
+
};
|
|
289
|
+
readonly highWatermark: {
|
|
290
|
+
readonly type: "integer";
|
|
291
|
+
readonly minimum: 0;
|
|
292
|
+
readonly description: "The context's current counter value; 0 for a context that has never been written. This is what a consumer stores as its next `sinceVersion` — NOT the maximum version among `items`, which is wrong whenever a `prefix` filtered a later change out, and undefined when the page is empty. A paginating consumer MUST NOT advance its stored watermark until it has drained the final page — the one with no `nextCursor` — because the pages of one feed share this value and adopting it early would skip the items still to come.";
|
|
293
|
+
};
|
|
294
|
+
readonly tombstoneRetentionSeconds: {
|
|
295
|
+
readonly type: "integer";
|
|
296
|
+
readonly minimum: 0;
|
|
297
|
+
readonly description: "How long this maintainer retains tombstones before reaping them. Advisory, so a consumer can schedule its syncs to stay inside the window rather than discovering it has fallen out of it via vta/memory/list:watermarkTooOld.";
|
|
298
|
+
};
|
|
299
|
+
readonly ext: {
|
|
300
|
+
readonly $ref: "#/$defs/Ext";
|
|
301
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
302
|
+
};
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
readonly Ext: {
|
|
306
|
+
readonly title: "Ext";
|
|
307
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
308
|
+
readonly type: "object";
|
|
309
|
+
readonly minProperties: 1;
|
|
310
|
+
readonly additionalProperties: true;
|
|
311
|
+
readonly propertyNames: {
|
|
312
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
readonly MemoryRecord: {
|
|
316
|
+
readonly title: "MemoryRecord";
|
|
317
|
+
readonly description: "A memory item as the maintainer holds it. `value` is absent in two distinct situations and a consumer MUST NOT conflate them: the item is a tombstone (`deleted` is true), or the caller asked for a metadata-only view (`vta/memory/list` without `includeValues`). This is why `deleted` is required rather than defaulted — a consumer that infers deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
318
|
+
readonly type: "object";
|
|
319
|
+
readonly additionalProperties: false;
|
|
320
|
+
readonly required: readonly ["contextId", "key", "version", "deleted", "updatedAt"];
|
|
321
|
+
readonly properties: {
|
|
322
|
+
readonly contextId: {
|
|
323
|
+
readonly type: "string";
|
|
324
|
+
readonly minLength: 1;
|
|
325
|
+
readonly description: "The VTA context the item is scoped to; the isolation boundary.";
|
|
326
|
+
};
|
|
327
|
+
readonly key: {
|
|
328
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
329
|
+
};
|
|
330
|
+
readonly version: {
|
|
331
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
332
|
+
readonly description: "The context counter value this item's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
333
|
+
};
|
|
334
|
+
readonly value: {
|
|
335
|
+
readonly $ref: "#/$defs/MemoryValue";
|
|
336
|
+
readonly description: "The remembered text. Absent when this is a tombstone or a metadata-only view.";
|
|
337
|
+
};
|
|
338
|
+
readonly valueBytes: {
|
|
339
|
+
readonly type: "integer";
|
|
340
|
+
readonly minimum: 0;
|
|
341
|
+
readonly description: "Size of the stored value in bytes over its UTF-8 encoding, as the maintainer measures it for the per-item cap. Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
342
|
+
};
|
|
343
|
+
readonly deleted: {
|
|
344
|
+
readonly type: "boolean";
|
|
345
|
+
readonly description: "True when this is a tombstone: the item was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/memory/list`.";
|
|
346
|
+
};
|
|
347
|
+
readonly createdAt: {
|
|
348
|
+
readonly type: "string";
|
|
349
|
+
readonly format: "date-time";
|
|
350
|
+
readonly description: "When the item was first created at this key. MAY be absent on a tombstone whose body has been discarded, and on an item written before the maintainer kept versions.";
|
|
351
|
+
};
|
|
352
|
+
readonly updatedAt: {
|
|
353
|
+
readonly type: "string";
|
|
354
|
+
readonly format: "date-time";
|
|
355
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
356
|
+
};
|
|
357
|
+
readonly deletedAt: {
|
|
358
|
+
readonly type: "string";
|
|
359
|
+
readonly format: "date-time";
|
|
360
|
+
readonly description: "When the item was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
361
|
+
};
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
readonly MemoryValue: {
|
|
365
|
+
readonly title: "MemoryValue";
|
|
366
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
367
|
+
readonly type: "string";
|
|
368
|
+
};
|
|
369
|
+
readonly MemoryVersion: {
|
|
370
|
+
readonly title: "MemoryVersion";
|
|
371
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
372
|
+
readonly type: "integer";
|
|
373
|
+
readonly minimum: 1;
|
|
374
|
+
};
|
|
375
|
+
readonly MemoryKey: {
|
|
376
|
+
readonly title: "MemoryKey";
|
|
377
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
378
|
+
readonly type: "string";
|
|
379
|
+
readonly minLength: 1;
|
|
380
|
+
readonly maxLength: 512;
|
|
381
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
/**
|
|
386
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
387
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
388
|
+
* per-specification and cannot be derived from the document alone, and
|
|
389
|
+
* item 2 needs the schema this carries.
|
|
390
|
+
*/
|
|
391
|
+
export declare const SPEC: {
|
|
392
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/memory/list/0.2";
|
|
393
|
+
readonly isBearer: false;
|
|
394
|
+
readonly isProofRequired: false;
|
|
395
|
+
readonly isRecipientRequired: true;
|
|
396
|
+
readonly isIssuedAtRequired: true;
|
|
397
|
+
readonly payloadSchema: {
|
|
398
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
399
|
+
readonly $id: "https://trusttasks.org/spec/vta/memory/list/0.2";
|
|
400
|
+
readonly title: "VTA Memory List — payload";
|
|
401
|
+
readonly description: "Enumerate the memory items in a context. Two modes, distinguished by whether `sinceVersion` is supplied. Without it this is a SNAPSHOT of live items, optionally narrowed by `prefix`. With it this is a CHANGE FEED: every item in the context whose version exceeds the watermark, tombstones included, which is what lets an agent's local cache on another device converge. Pagination is opaque-cursor based.";
|
|
402
|
+
readonly type: "object";
|
|
403
|
+
readonly additionalProperties: false;
|
|
404
|
+
readonly required: readonly ["contextId"];
|
|
405
|
+
readonly properties: {
|
|
406
|
+
readonly contextId: {
|
|
407
|
+
readonly type: "string";
|
|
408
|
+
readonly minLength: 1;
|
|
409
|
+
readonly description: "The VTA context to enumerate; the isolation boundary.";
|
|
410
|
+
};
|
|
411
|
+
readonly prefix: {
|
|
412
|
+
readonly type: "string";
|
|
413
|
+
readonly minLength: 1;
|
|
414
|
+
readonly maxLength: 512;
|
|
415
|
+
readonly description: "Restrict to items whose `key` begins with this byte prefix, compared over the UTF-8 encoding. Lets an agent recall one family of items — `contact/`, `preference/` — without dragging the whole context through the response.";
|
|
416
|
+
};
|
|
417
|
+
readonly sinceVersion: {
|
|
418
|
+
readonly type: "integer";
|
|
419
|
+
readonly minimum: 0;
|
|
420
|
+
readonly description: "Watermark. Selects change-feed mode: only items whose `version` is strictly greater are returned, tombstones included. Supply the `highWatermark` from the previous sync, or 0 for a first full pull in change-feed form.";
|
|
421
|
+
};
|
|
422
|
+
readonly includeValues: {
|
|
423
|
+
readonly type: "boolean";
|
|
424
|
+
readonly description: "When true, each returned item carries its `value`. Defaults to TRUE — unlike vta/app-state/list — because recalling the text is what an agent lists memory for, and 0.1 always returned values. Set it false for the metadata view (key, version, timestamps, `valueBytes`), which makes a scan of a large context cheap.";
|
|
425
|
+
};
|
|
426
|
+
readonly includeDeleted: {
|
|
427
|
+
readonly type: "boolean";
|
|
428
|
+
readonly description: "Snapshot mode only: when true, tombstones still inside the retention window are returned alongside live items. Defaults to false. In change-feed mode tombstones are always returned and this member MUST NOT be set to false — a change feed that omits deletions cannot converge.";
|
|
429
|
+
};
|
|
430
|
+
readonly cursor: {
|
|
431
|
+
readonly type: "string";
|
|
432
|
+
readonly description: "An opaque continuation token from a previous response's `nextCursor`; a responder MUST NOT accept a cursor it did not issue. Consumers MUST treat it as opaque: never construct, decode, mutate, or infer meaning from one.";
|
|
433
|
+
};
|
|
434
|
+
readonly limit: {
|
|
435
|
+
readonly type: "integer";
|
|
436
|
+
readonly minimum: 1;
|
|
437
|
+
readonly maximum: 1000;
|
|
438
|
+
readonly description: "The most items to return; the responder chooses a default and MAY return fewer, which is likely when `includeValues` is in effect and the values are large.";
|
|
439
|
+
};
|
|
440
|
+
readonly ext: {
|
|
441
|
+
readonly $ref: "#/$defs/Ext";
|
|
442
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
443
|
+
};
|
|
444
|
+
};
|
|
445
|
+
readonly $defs: {
|
|
446
|
+
readonly Response: {
|
|
447
|
+
readonly $anchor: "response";
|
|
448
|
+
readonly title: "VTA Memory List — response payload";
|
|
449
|
+
readonly description: "Success response to vta/memory/list. Type https://trusttasks.org/spec/vta/memory/list/0.2#response.";
|
|
450
|
+
readonly type: "object";
|
|
451
|
+
readonly additionalProperties: false;
|
|
452
|
+
readonly required: readonly ["items", "highWatermark"];
|
|
453
|
+
readonly properties: {
|
|
454
|
+
readonly items: {
|
|
455
|
+
readonly type: "array";
|
|
456
|
+
readonly items: {
|
|
457
|
+
readonly $ref: "#/$defs/MemoryRecord";
|
|
458
|
+
};
|
|
459
|
+
readonly description: "Matching items in ascending key order in snapshot mode, and ascending version order in change-feed mode — the latter so that a consumer applying them in order reaches the same state as the maintainer. May be empty.";
|
|
460
|
+
};
|
|
461
|
+
readonly nextCursor: {
|
|
462
|
+
readonly type: "string";
|
|
463
|
+
readonly description: "Opaque continuation token for the next page, sent back as the request's `cursor`. Present when more matching items exist beyond this page; absent on the last page.";
|
|
464
|
+
};
|
|
465
|
+
readonly highWatermark: {
|
|
466
|
+
readonly type: "integer";
|
|
467
|
+
readonly minimum: 0;
|
|
468
|
+
readonly description: "The context's current counter value; 0 for a context that has never been written. This is what a consumer stores as its next `sinceVersion` — NOT the maximum version among `items`, which is wrong whenever a `prefix` filtered a later change out, and undefined when the page is empty. A paginating consumer MUST NOT advance its stored watermark until it has drained the final page — the one with no `nextCursor` — because the pages of one feed share this value and adopting it early would skip the items still to come.";
|
|
469
|
+
};
|
|
470
|
+
readonly tombstoneRetentionSeconds: {
|
|
471
|
+
readonly type: "integer";
|
|
472
|
+
readonly minimum: 0;
|
|
473
|
+
readonly description: "How long this maintainer retains tombstones before reaping them. Advisory, so a consumer can schedule its syncs to stay inside the window rather than discovering it has fallen out of it via vta/memory/list:watermarkTooOld.";
|
|
474
|
+
};
|
|
475
|
+
readonly ext: {
|
|
476
|
+
readonly $ref: "#/$defs/Ext";
|
|
477
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
readonly Ext: {
|
|
482
|
+
readonly title: "Ext";
|
|
483
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
484
|
+
readonly type: "object";
|
|
485
|
+
readonly minProperties: 1;
|
|
486
|
+
readonly additionalProperties: true;
|
|
487
|
+
readonly propertyNames: {
|
|
488
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
readonly MemoryRecord: {
|
|
492
|
+
readonly title: "MemoryRecord";
|
|
493
|
+
readonly description: "A memory item as the maintainer holds it. `value` is absent in two distinct situations and a consumer MUST NOT conflate them: the item is a tombstone (`deleted` is true), or the caller asked for a metadata-only view (`vta/memory/list` without `includeValues`). This is why `deleted` is required rather than defaulted — a consumer that infers deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
494
|
+
readonly type: "object";
|
|
495
|
+
readonly additionalProperties: false;
|
|
496
|
+
readonly required: readonly ["contextId", "key", "version", "deleted", "updatedAt"];
|
|
497
|
+
readonly properties: {
|
|
498
|
+
readonly contextId: {
|
|
499
|
+
readonly type: "string";
|
|
500
|
+
readonly minLength: 1;
|
|
501
|
+
readonly description: "The VTA context the item is scoped to; the isolation boundary.";
|
|
502
|
+
};
|
|
503
|
+
readonly key: {
|
|
504
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
505
|
+
};
|
|
506
|
+
readonly version: {
|
|
507
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
508
|
+
readonly description: "The context counter value this item's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
509
|
+
};
|
|
510
|
+
readonly value: {
|
|
511
|
+
readonly $ref: "#/$defs/MemoryValue";
|
|
512
|
+
readonly description: "The remembered text. Absent when this is a tombstone or a metadata-only view.";
|
|
513
|
+
};
|
|
514
|
+
readonly valueBytes: {
|
|
515
|
+
readonly type: "integer";
|
|
516
|
+
readonly minimum: 0;
|
|
517
|
+
readonly description: "Size of the stored value in bytes over its UTF-8 encoding, as the maintainer measures it for the per-item cap. Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
518
|
+
};
|
|
519
|
+
readonly deleted: {
|
|
520
|
+
readonly type: "boolean";
|
|
521
|
+
readonly description: "True when this is a tombstone: the item was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/memory/list`.";
|
|
522
|
+
};
|
|
523
|
+
readonly createdAt: {
|
|
524
|
+
readonly type: "string";
|
|
525
|
+
readonly format: "date-time";
|
|
526
|
+
readonly description: "When the item was first created at this key. MAY be absent on a tombstone whose body has been discarded, and on an item written before the maintainer kept versions.";
|
|
527
|
+
};
|
|
528
|
+
readonly updatedAt: {
|
|
529
|
+
readonly type: "string";
|
|
530
|
+
readonly format: "date-time";
|
|
531
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
532
|
+
};
|
|
533
|
+
readonly deletedAt: {
|
|
534
|
+
readonly type: "string";
|
|
535
|
+
readonly format: "date-time";
|
|
536
|
+
readonly description: "When the item was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
537
|
+
};
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
readonly MemoryValue: {
|
|
541
|
+
readonly title: "MemoryValue";
|
|
542
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
543
|
+
readonly type: "string";
|
|
544
|
+
};
|
|
545
|
+
readonly MemoryVersion: {
|
|
546
|
+
readonly title: "MemoryVersion";
|
|
547
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
548
|
+
readonly type: "integer";
|
|
549
|
+
readonly minimum: 1;
|
|
550
|
+
};
|
|
551
|
+
readonly MemoryKey: {
|
|
552
|
+
readonly title: "MemoryKey";
|
|
553
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
554
|
+
readonly type: "string";
|
|
555
|
+
readonly minLength: 1;
|
|
556
|
+
readonly maxLength: 512;
|
|
557
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
/**
|
|
563
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
564
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
565
|
+
* parties (§7.3 item 5).
|
|
566
|
+
*/
|
|
567
|
+
export declare const RESPONSE_SPEC: {
|
|
568
|
+
readonly typeUri: "https://trusttasks.org/spec/vta/memory/list/0.2#response";
|
|
569
|
+
readonly isBearer: false;
|
|
570
|
+
readonly isProofRequired: true;
|
|
571
|
+
readonly isRecipientRequired: true;
|
|
572
|
+
readonly isIssuedAtRequired: true;
|
|
573
|
+
readonly payloadSchema: {
|
|
574
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
575
|
+
readonly $ref: "#/$defs/Response";
|
|
576
|
+
readonly $defs: {
|
|
577
|
+
readonly Response: {
|
|
578
|
+
readonly $anchor: "response";
|
|
579
|
+
readonly title: "VTA Memory List — response payload";
|
|
580
|
+
readonly description: "Success response to vta/memory/list. Type https://trusttasks.org/spec/vta/memory/list/0.2#response.";
|
|
581
|
+
readonly type: "object";
|
|
582
|
+
readonly additionalProperties: false;
|
|
583
|
+
readonly required: readonly ["items", "highWatermark"];
|
|
584
|
+
readonly properties: {
|
|
585
|
+
readonly items: {
|
|
586
|
+
readonly type: "array";
|
|
587
|
+
readonly items: {
|
|
588
|
+
readonly $ref: "#/$defs/MemoryRecord";
|
|
589
|
+
};
|
|
590
|
+
readonly description: "Matching items in ascending key order in snapshot mode, and ascending version order in change-feed mode — the latter so that a consumer applying them in order reaches the same state as the maintainer. May be empty.";
|
|
591
|
+
};
|
|
592
|
+
readonly nextCursor: {
|
|
593
|
+
readonly type: "string";
|
|
594
|
+
readonly description: "Opaque continuation token for the next page, sent back as the request's `cursor`. Present when more matching items exist beyond this page; absent on the last page.";
|
|
595
|
+
};
|
|
596
|
+
readonly highWatermark: {
|
|
597
|
+
readonly type: "integer";
|
|
598
|
+
readonly minimum: 0;
|
|
599
|
+
readonly description: "The context's current counter value; 0 for a context that has never been written. This is what a consumer stores as its next `sinceVersion` — NOT the maximum version among `items`, which is wrong whenever a `prefix` filtered a later change out, and undefined when the page is empty. A paginating consumer MUST NOT advance its stored watermark until it has drained the final page — the one with no `nextCursor` — because the pages of one feed share this value and adopting it early would skip the items still to come.";
|
|
600
|
+
};
|
|
601
|
+
readonly tombstoneRetentionSeconds: {
|
|
602
|
+
readonly type: "integer";
|
|
603
|
+
readonly minimum: 0;
|
|
604
|
+
readonly description: "How long this maintainer retains tombstones before reaping them. Advisory, so a consumer can schedule its syncs to stay inside the window rather than discovering it has fallen out of it via vta/memory/list:watermarkTooOld.";
|
|
605
|
+
};
|
|
606
|
+
readonly ext: {
|
|
607
|
+
readonly $ref: "#/$defs/Ext";
|
|
608
|
+
readonly description: "Ecosystem-defined extension members per SPEC.md §4.5.1.";
|
|
609
|
+
};
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
readonly Ext: {
|
|
613
|
+
readonly title: "Ext";
|
|
614
|
+
readonly description: "Vendor-namespaced extension object per SPEC.md §4.5.1. Each immediate key MUST be a reverse-DNS namespace; structure under each namespace is opaque to the framework.";
|
|
615
|
+
readonly type: "object";
|
|
616
|
+
readonly minProperties: 1;
|
|
617
|
+
readonly additionalProperties: true;
|
|
618
|
+
readonly propertyNames: {
|
|
619
|
+
readonly pattern: "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$";
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
readonly MemoryRecord: {
|
|
623
|
+
readonly title: "MemoryRecord";
|
|
624
|
+
readonly description: "A memory item as the maintainer holds it. `value` is absent in two distinct situations and a consumer MUST NOT conflate them: the item is a tombstone (`deleted` is true), or the caller asked for a metadata-only view (`vta/memory/list` without `includeValues`). This is why `deleted` is required rather than defaulted — a consumer that infers deletion from an absent value gets the tombstone case wrong exactly when convergence depends on it.";
|
|
625
|
+
readonly type: "object";
|
|
626
|
+
readonly additionalProperties: false;
|
|
627
|
+
readonly required: readonly ["contextId", "key", "version", "deleted", "updatedAt"];
|
|
628
|
+
readonly properties: {
|
|
629
|
+
readonly contextId: {
|
|
630
|
+
readonly type: "string";
|
|
631
|
+
readonly minLength: 1;
|
|
632
|
+
readonly description: "The VTA context the item is scoped to; the isolation boundary.";
|
|
633
|
+
};
|
|
634
|
+
readonly key: {
|
|
635
|
+
readonly $ref: "#/$defs/MemoryKey";
|
|
636
|
+
};
|
|
637
|
+
readonly version: {
|
|
638
|
+
readonly $ref: "#/$defs/MemoryVersion";
|
|
639
|
+
readonly description: "The context counter value this item's most recent write took. Supply it as `expectedVersion` on the next write to make that write conditional on nothing having changed in between.";
|
|
640
|
+
};
|
|
641
|
+
readonly value: {
|
|
642
|
+
readonly $ref: "#/$defs/MemoryValue";
|
|
643
|
+
readonly description: "The remembered text. Absent when this is a tombstone or a metadata-only view.";
|
|
644
|
+
};
|
|
645
|
+
readonly valueBytes: {
|
|
646
|
+
readonly type: "integer";
|
|
647
|
+
readonly minimum: 0;
|
|
648
|
+
readonly description: "Size of the stored value in bytes over its UTF-8 encoding, as the maintainer measures it for the per-item cap. Present in metadata-only views so a consumer can decide what to fetch without fetching it; absent on a tombstone.";
|
|
649
|
+
};
|
|
650
|
+
readonly deleted: {
|
|
651
|
+
readonly type: "boolean";
|
|
652
|
+
readonly description: "True when this is a tombstone: the item was deleted, and this entry exists so that a consumer syncing incrementally learns of the deletion. Tombstones are reaped after the maintainer's retention window; see `vta/memory/list`.";
|
|
653
|
+
};
|
|
654
|
+
readonly createdAt: {
|
|
655
|
+
readonly type: "string";
|
|
656
|
+
readonly format: "date-time";
|
|
657
|
+
readonly description: "When the item was first created at this key. MAY be absent on a tombstone whose body has been discarded, and on an item written before the maintainer kept versions.";
|
|
658
|
+
};
|
|
659
|
+
readonly updatedAt: {
|
|
660
|
+
readonly type: "string";
|
|
661
|
+
readonly format: "date-time";
|
|
662
|
+
readonly description: "When the write that produced this `version` was applied. For a tombstone, when the delete was applied.";
|
|
663
|
+
};
|
|
664
|
+
readonly deletedAt: {
|
|
665
|
+
readonly type: "string";
|
|
666
|
+
readonly format: "date-time";
|
|
667
|
+
readonly description: "When the item was deleted. Present only when `deleted` is true; equal to `updatedAt` for a tombstone the maintainer has not since rewritten.";
|
|
668
|
+
};
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
readonly MemoryValue: {
|
|
672
|
+
readonly title: "MemoryValue";
|
|
673
|
+
readonly description: "The remembered text: a fact, a summary, a preference. Opaque to the maintainer, which stores it as given and never interprets, rewrites or summarises it. The maintainer enforces a documented per-item cap on its size (see `vta/memory/put`).";
|
|
674
|
+
readonly type: "string";
|
|
675
|
+
};
|
|
676
|
+
readonly MemoryVersion: {
|
|
677
|
+
readonly title: "MemoryVersion";
|
|
678
|
+
readonly description: "A value of the context's monotonic write counter (see this schema's description). Server-assigned; a producer never chooses one.";
|
|
679
|
+
readonly type: "integer";
|
|
680
|
+
readonly minimum: 1;
|
|
681
|
+
};
|
|
682
|
+
readonly MemoryKey: {
|
|
683
|
+
readonly title: "MemoryKey";
|
|
684
|
+
readonly description: "Agent-chosen identifier for an item within a context. Opaque to the maintainer: it MUST NOT be parsed, normalized, or case-folded, and prefix matching in `vta/memory/list` is a byte-prefix comparison over the UTF-8 encoding. Agents SHOULD use `/`-delimited hierarchical keys (`contact/billing`, `preference/timezone`) so that `prefix` can address a family of items, but the delimiter is a convention between an agent and itself. A key is content as well as an address: a key naming a person, a condition or a dispute discloses something to anyone who can list the context, even without its value.";
|
|
685
|
+
readonly type: "string";
|
|
686
|
+
readonly minLength: 1;
|
|
687
|
+
readonly maxLength: 512;
|
|
688
|
+
readonly pattern: "^[^\\u0000]+$";
|
|
689
|
+
};
|
|
690
|
+
};
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
//# sourceMappingURL=payload.d.ts.map
|