@openvtc/trust-tasks 0.27.9 → 0.28.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/dist/_runtime/codes.d.ts +1 -1
  3. package/dist/_runtime/codes.d.ts.map +1 -1
  4. package/dist/_runtime/codes.js +3 -0
  5. package/dist/_runtime/codes.js.map +1 -1
  6. package/dist/_runtime/document.d.ts +1 -1
  7. package/dist/_runtime/document.js +1 -1
  8. package/dist/_shared/components.d.ts +39 -0
  9. package/dist/_shared/components.d.ts.map +1 -1
  10. package/dist/index.d.ts +10 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +10 -0
  13. package/dist/index.js.map +1 -1
  14. package/dist/policy/_shared/0.4/policy.d.ts +16 -0
  15. package/dist/policy/_shared/0.4/policy.d.ts.map +1 -0
  16. package/dist/policy/_shared/0.4/policy.js +6 -0
  17. package/dist/policy/_shared/0.4/policy.js.map +1 -0
  18. package/dist/policy/evaluate/0.1/payload.d.ts +4 -4
  19. package/dist/policy/evaluate/0.1/payload.js +1 -1
  20. package/dist/policy/evaluate/0.2/payload.d.ts +4 -4
  21. package/dist/policy/evaluate/0.2/payload.js +1 -1
  22. package/dist/policy/evaluate/0.3/payload.d.ts +13 -2
  23. package/dist/policy/evaluate/0.3/payload.d.ts.map +1 -1
  24. package/dist/policy/evaluate/0.3/payload.js +1 -1
  25. package/dist/policy/evaluate/0.3/payload.js.map +1 -1
  26. package/dist/policy/evaluate/0.4/payload.d.ts +1416 -0
  27. package/dist/policy/evaluate/0.4/payload.d.ts.map +1 -0
  28. package/dist/policy/evaluate/0.4/payload.js +899 -0
  29. package/dist/policy/evaluate/0.4/payload.js.map +1 -0
  30. package/dist/trust-task-error/0.1/payload.d.ts +2 -2
  31. package/dist/trust-task-error/0.1/payload.js +1 -1
  32. package/dist/trust-task-error/0.2/payload.d.ts +2 -2
  33. package/dist/trust-task-error/0.2/payload.js +1 -1
  34. package/dist/trust-task-error/0.3/payload.d.ts +2 -2
  35. package/dist/trust-task-error/0.3/payload.js +1 -1
  36. package/dist/trust-task-error/0.4/payload.d.ts +2 -2
  37. package/dist/trust-task-error/0.4/payload.js +1 -1
  38. package/dist/trust-task-error/0.5/payload.d.ts +7 -1
  39. package/dist/trust-task-error/0.5/payload.d.ts.map +1 -1
  40. package/dist/trust-task-error/0.5/payload.js +1 -1
  41. package/dist/trust-task-error/0.5/payload.js.map +1 -1
  42. package/dist/trust-task-error/0.6/payload.d.ts +199 -0
  43. package/dist/trust-task-error/0.6/payload.d.ts.map +1 -0
  44. package/dist/trust-task-error/0.6/payload.js +126 -0
  45. package/dist/trust-task-error/0.6/payload.js.map +1 -0
  46. package/dist/vta/contexts/delete/1.0/payload.d.ts +13 -2
  47. package/dist/vta/contexts/delete/1.0/payload.d.ts.map +1 -1
  48. package/dist/vta/contexts/delete/1.0/payload.js +1 -1
  49. package/dist/vta/contexts/delete/1.0/payload.js.map +1 -1
  50. package/dist/vta/contexts/delete/1.1/payload.d.ts +315 -0
  51. package/dist/vta/contexts/delete/1.1/payload.d.ts.map +1 -0
  52. package/dist/vta/contexts/delete/1.1/payload.js +178 -0
  53. package/dist/vta/contexts/delete/1.1/payload.js.map +1 -0
  54. package/package.json +1 -1
  55. package/src/_runtime/codes.ts +3 -0
  56. package/src/_runtime/document.ts +1 -1
  57. package/src/_shared/components.ts +39 -0
  58. package/src/index.ts +10 -0
  59. package/src/policy/_shared/0.4/policy.ts +17 -0
  60. package/src/policy/evaluate/0.1/payload.ts +5 -5
  61. package/src/policy/evaluate/0.2/payload.ts +5 -5
  62. package/src/policy/evaluate/0.3/payload.ts +14 -3
  63. package/src/policy/evaluate/0.4/payload.ts +944 -0
  64. package/src/trust-task-error/0.1/payload.ts +3 -3
  65. package/src/trust-task-error/0.2/payload.ts +3 -3
  66. package/src/trust-task-error/0.3/payload.ts +3 -3
  67. package/src/trust-task-error/0.4/payload.ts +3 -3
  68. package/src/trust-task-error/0.5/payload.ts +8 -2
  69. package/src/trust-task-error/0.6/payload.ts +195 -0
  70. package/src/vta/contexts/delete/1.0/payload.ts +14 -3
  71. package/src/vta/contexts/delete/1.1/payload.ts +228 -0
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -67,12 +67,12 @@ export const EXTENDS: string | null = null;
67
67
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
68
68
  * Versions").
69
69
  */
70
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
70
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
71
71
 
72
72
  /**
73
73
  * Stable alias for this specification's request payload shape.
74
74
  *
75
- * @deprecated superseded by trust-task-error/0.5
75
+ * @deprecated superseded by trust-task-error/0.6
76
76
  */
77
77
  export type Payload = TrustTaskErrorPayload;
78
78
 
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -67,12 +67,12 @@ export const EXTENDS: string | null = null;
67
67
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
68
68
  * Versions").
69
69
  */
70
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
70
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
71
71
 
72
72
  /**
73
73
  * Stable alias for this specification's request payload shape.
74
74
  *
75
- * @deprecated superseded by trust-task-error/0.5
75
+ * @deprecated superseded by trust-task-error/0.6
76
76
  */
77
77
  export type Payload = TrustTaskErrorPayload;
78
78
 
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -80,12 +80,12 @@ export const EXTENDS: string | null = null;
80
80
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
81
81
  * Versions").
82
82
  */
83
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
83
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
84
84
 
85
85
  /**
86
86
  * Stable alias for this specification's request payload shape.
87
87
  *
88
- * @deprecated superseded by trust-task-error/0.5
88
+ * @deprecated superseded by trust-task-error/0.6
89
89
  */
90
90
  export type Payload = TrustTaskErrorPayload;
91
91
 
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
8
  *
9
- * @deprecated superseded by trust-task-error/0.5
9
+ * @deprecated superseded by trust-task-error/0.6
10
10
  */
11
11
  export interface TrustTaskErrorPayload {
12
12
  /**
@@ -81,12 +81,12 @@ export const EXTENDS: string | null = null;
81
81
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
82
82
  * Versions").
83
83
  */
84
- export const DEPRECATION: string | null = "superseded by trust-task-error/0.5";
84
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
85
85
 
86
86
  /**
87
87
  * Stable alias for this specification's request payload shape.
88
88
  *
89
- * @deprecated superseded by trust-task-error/0.5
89
+ * @deprecated superseded by trust-task-error/0.6
90
90
  */
91
91
  export type Payload = TrustTaskErrorPayload;
92
92
 
@@ -5,6 +5,8 @@
5
5
 
6
6
  /**
7
7
  * The canonical error-response payload per SPEC.md §8.2.
8
+ *
9
+ * @deprecated superseded by trust-task-error/0.6
8
10
  */
9
11
  export interface TrustTaskErrorPayload {
10
12
  /**
@@ -80,9 +82,13 @@ export const EXTENDS: string | null = null;
80
82
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
81
83
  * Versions").
82
84
  */
83
- export const DEPRECATION: string | null = null;
85
+ export const DEPRECATION: string | null = "superseded by trust-task-error/0.6";
84
86
 
85
- /** Stable alias for this specification's request payload shape. */
87
+ /**
88
+ * Stable alias for this specification's request payload shape.
89
+ *
90
+ * @deprecated superseded by trust-task-error/0.6
91
+ */
86
92
  export type Payload = TrustTaskErrorPayload;
87
93
 
88
94
  /**
@@ -0,0 +1,195 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/trust-task-error/0.6/payload.schema.json
4
+ */
5
+
6
+ /**
7
+ * The canonical error-response payload per SPEC.md §8.2.
8
+ */
9
+ export interface TrustTaskErrorPayload {
10
+ /**
11
+ * Short identifier for the failure category. MUST be either a framework standard code (SPEC.md §8.3) or an extended code namespaced by the originating spec's slug (SPEC.md §8.5, e.g. 'acl/grant:roleNotRecognized').
12
+ */
13
+ code: (
14
+ | (
15
+ | "malformedRequest"
16
+ | "unsupportedType"
17
+ | "unsupportedVersion"
18
+ | "expired"
19
+ | "proofRequired"
20
+ | "proofInvalid"
21
+ | "permissionDenied"
22
+ | "wrongRecipient"
23
+ | "identityMismatch"
24
+ | "idConflict"
25
+ | "cancelled"
26
+ | "taskFailed"
27
+ | "unavailable"
28
+ | "internalError"
29
+ | "unsupportedExtension"
30
+ | "indeterminate"
31
+ )
32
+ | {
33
+ [k: string]: unknown | undefined;
34
+ }
35
+ ) &
36
+ string;
37
+ /**
38
+ * Identifies the Trust Task document this error reports on. RECOMMENDED on every error response, and REQUIRED in practice for any error a third party may later be asked to rely on: threadId correlates the exchange only for a party that saw the request, so without this an error retained as evidence names neither the task it terminated nor the instance.
39
+ */
40
+ inResponseTo?: {
41
+ /**
42
+ * The Type URI of the document being reported on, including any #request or #response fragment it carried. This is what tells a consumer which specification's semantics apply to an extended code, and which specification declared the requirement that was breached.
43
+ */
44
+ typeUri: string;
45
+ /**
46
+ * The id of the specific document being reported on (SPEC §4.3). Globally unique and never reused, so it names one instance where threadId names an exchange. Omit only where echoing it would disclose more than the error already does.
47
+ */
48
+ id?: string;
49
+ };
50
+ /**
51
+ * Human-readable description of the error. Non-normative; intended for logs and operator UI.
52
+ */
53
+ message?: string;
54
+ /**
55
+ * true if the producer of the original document MAY retry; false if retrying with the same document is not expected to succeed.
56
+ */
57
+ retryable: boolean;
58
+ /**
59
+ * RFC 3339 timestamp before which the producer SHOULD NOT retry. Meaningful only when retryable is true.
60
+ */
61
+ retryAfter?: string;
62
+ /**
63
+ * Optional task-specific extension data. Per-spec error code declarations may pin the shape via a JSON Schema fragment.
64
+ */
65
+ details?: {};
66
+ }
67
+
68
+ /** Trust Task type URI. */
69
+ export const TYPE_URI = "https://trusttasks.org/spec/trust-task-error/0.6" as const;
70
+
71
+ /**
72
+ * The earlier version of this specification that this one declares it
73
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
74
+ * `null`. Only the direct declaration — follow the chain with
75
+ * `extendsChain` / `readForSpec`.
76
+ */
77
+ export const EXTENDS: string | null = "0.5";
78
+
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 const DEPRECATION: string | null = null;
86
+
87
+ /** Stable alias for this specification's request payload shape. */
88
+ export type Payload = TrustTaskErrorPayload;
89
+
90
+ /**
91
+ * This specification's payload schema, as a value.
92
+ *
93
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
94
+ * rather than only as a `.json` file because TypeScript types are erased
95
+ * at runtime: without a schema a consumer has nothing to validate, and
96
+ * every REQUIRED payload member is optional in practice. Cross-file
97
+ * `$ref`s are already inlined, so it needs no resolver.
98
+ */
99
+ export const PAYLOAD_SCHEMA = {
100
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
101
+ "$id": "https://trusttasks.org/spec/trust-task-error/0.6",
102
+ "title": "Trust Task Error — payload",
103
+ "description": "The canonical error-response payload per SPEC.md §8.2.",
104
+ "type": "object",
105
+ "additionalProperties": false,
106
+ "required": [
107
+ "code",
108
+ "retryable"
109
+ ],
110
+ "properties": {
111
+ "code": {
112
+ "type": "string",
113
+ "description": "Short identifier for the failure category. MUST be either a framework standard code (SPEC.md §8.3) or an extended code namespaced by the originating spec's slug (SPEC.md §8.5, e.g. 'acl/grant:roleNotRecognized').",
114
+ "anyOf": [
115
+ {
116
+ "enum": [
117
+ "malformedRequest",
118
+ "unsupportedType",
119
+ "unsupportedVersion",
120
+ "expired",
121
+ "proofRequired",
122
+ "proofInvalid",
123
+ "permissionDenied",
124
+ "wrongRecipient",
125
+ "identityMismatch",
126
+ "idConflict",
127
+ "cancelled",
128
+ "taskFailed",
129
+ "unavailable",
130
+ "internalError",
131
+ "unsupportedExtension",
132
+ "indeterminate"
133
+ ]
134
+ },
135
+ {
136
+ "pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*(/[a-z][a-z0-9]*(-[a-z0-9]+)*)*:[a-z][a-zA-Z0-9_]*$"
137
+ }
138
+ ]
139
+ },
140
+ "inResponseTo": {
141
+ "type": "object",
142
+ "additionalProperties": false,
143
+ "required": [
144
+ "typeUri"
145
+ ],
146
+ "description": "Identifies the Trust Task document this error reports on. RECOMMENDED on every error response, and REQUIRED in practice for any error a third party may later be asked to rely on: threadId correlates the exchange only for a party that saw the request, so without this an error retained as evidence names neither the task it terminated nor the instance.",
147
+ "properties": {
148
+ "typeUri": {
149
+ "type": "string",
150
+ "format": "uri",
151
+ "minLength": 1,
152
+ "description": "The Type URI of the document being reported on, including any #request or #response fragment it carried. This is what tells a consumer which specification's semantics apply to an extended code, and which specification declared the requirement that was breached."
153
+ },
154
+ "id": {
155
+ "type": "string",
156
+ "minLength": 1,
157
+ "description": "The id of the specific document being reported on (SPEC §4.3). Globally unique and never reused, so it names one instance where threadId names an exchange. Omit only where echoing it would disclose more than the error already does."
158
+ }
159
+ }
160
+ },
161
+ "message": {
162
+ "type": "string",
163
+ "maxLength": 1024,
164
+ "description": "Human-readable description of the error. Non-normative; intended for logs and operator UI."
165
+ },
166
+ "retryable": {
167
+ "type": "boolean",
168
+ "description": "true if the producer of the original document MAY retry; false if retrying with the same document is not expected to succeed."
169
+ },
170
+ "retryAfter": {
171
+ "type": "string",
172
+ "format": "date-time",
173
+ "description": "RFC 3339 timestamp before which the producer SHOULD NOT retry. Meaningful only when retryable is true."
174
+ },
175
+ "details": {
176
+ "type": "object",
177
+ "description": "Optional task-specific extension data. Per-spec error code declarations may pin the shape via a JSON Schema fragment."
178
+ }
179
+ }
180
+ } as const;
181
+
182
+ /**
183
+ * SPEC.md §7.2 policy for the request variant, from this specification's
184
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
185
+ * per-specification and cannot be derived from the document alone, and
186
+ * item 2 needs the schema this carries.
187
+ */
188
+ export const SPEC = {
189
+ typeUri: TYPE_URI,
190
+ isBearer: false,
191
+ isProofRequired: false,
192
+ isRecipientRequired: true,
193
+ isIssuedAtRequired: false,
194
+ payloadSchema: PAYLOAD_SCHEMA,
195
+ } as const;
@@ -6,6 +6,7 @@
6
6
  import type { Ext } from "../../../../_shared/components.js";
7
7
 
8
8
 
9
+ /** @deprecated superseded by vta/contexts/delete/1.1 */
9
10
  export interface VTAContextsDeletePayload {
10
11
  /**
11
12
  * Context to delete.
@@ -19,6 +20,8 @@ export interface VTAContextsDeletePayload {
19
20
  }
20
21
  /**
21
22
  * Success response to vta/contexts/delete. Type https://trusttasks.org/spec/vta/contexts/delete/1.0#response.
23
+ *
24
+ * @deprecated superseded by vta/contexts/delete/1.1
22
25
  */
23
26
  export interface VTAContextsDeleteResponsePayload {
24
27
  id: string;
@@ -53,15 +56,23 @@ export const EXTENDS: string | null = null;
53
56
  * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
54
57
  * Versions").
55
58
  */
56
- export const DEPRECATION: string | null = null;
59
+ export const DEPRECATION: string | null = "superseded by vta/contexts/delete/1.1";
57
60
 
58
- /** Stable alias for this specification's request payload shape. */
61
+ /**
62
+ * Stable alias for this specification's request payload shape.
63
+ *
64
+ * @deprecated superseded by vta/contexts/delete/1.1
65
+ */
59
66
  export type Payload = VTAContextsDeletePayload;
60
67
 
61
68
  /** Trust Task response type URI (request type URI + "#response"). */
62
69
  export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/contexts/delete/1.0#response" as const;
63
70
 
64
- /** Stable alias for this specification's success-response payload shape. */
71
+ /**
72
+ * Stable alias for this specification's success-response payload shape.
73
+ *
74
+ * @deprecated superseded by vta/contexts/delete/1.1
75
+ */
65
76
  export type Response = VTAContextsDeleteResponsePayload;
66
77
 
67
78
  /**
@@ -0,0 +1,228 @@
1
+ /**
2
+ * Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
3
+ * Source: specs/vta/contexts/delete/1.1/payload.schema.json
4
+ */
5
+
6
+ import type { Ext } from "../../../../_shared/components.js";
7
+
8
+
9
+ export interface VTAContextsDeletePayload {
10
+ /**
11
+ * Context to delete.
12
+ */
13
+ id: string;
14
+ /**
15
+ * Delete even though the context still holds keys, DIDs or templates. Default false, and the default is the point: without it a context holding anything is refused, so the destructive case is always something a caller asked for explicitly.
16
+ */
17
+ force?: boolean;
18
+ /**
19
+ * Complete the deletion even where the published log of a `did:webvh` DID in the subtree could not be confirmed removed from its hosting server — the server unreachable, refusing, or no longer known to the VTA. Default false: such a deletion is refused with `vta/contexts/delete:hostCleanupFailed` and nothing is deleted locally, so the caller can wait for the host and retry. True accepts that the named DIDs may keep resolving and that removing them is now the caller's responsibility; each is reported in `daemonCleanupErrors`.
20
+ */
21
+ abandonHostCopies?: boolean;
22
+ ext?: Ext;
23
+ }
24
+ /**
25
+ * Success response to vta/contexts/delete. Type https://trusttasks.org/spec/vta/contexts/delete/1.1#response.
26
+ */
27
+ export interface VTAContextsDeleteResponsePayload {
28
+ id: string;
29
+ /**
30
+ * Whether the context was removed. A successful response carrying `false` means the VTA declined to act — it is not an error, and a consumer MUST NOT report the deletion as done on the basis of the response status alone.
31
+ */
32
+ deleted: boolean;
33
+ /**
34
+ * One entry per `did:webvh` DID in the deleted subtree whose local record was removed while its hosting server did not confirm removal of the published log. **Those DIDs may still resolve.** Only ever present when the request set `abandonHostCopies`; a requester that did not is refused instead. A consumer MUST surface it rather than treating the deletion as complete. Absent or empty means every host copy was confirmed gone.
35
+ */
36
+ daemonCleanupErrors?: string[];
37
+ ext?: Ext;
38
+ }
39
+
40
+ /** Shared definitions this specification references, re-exported under the names it used to declare them with. */
41
+ export type { Ext };
42
+
43
+ /** Trust Task type URI. */
44
+ export const TYPE_URI = "https://trusttasks.org/spec/vta/contexts/delete/1.1" as const;
45
+
46
+ /**
47
+ * The earlier version of this specification that this one declares it
48
+ * extends (front matter `extends`, SPEC §5.2 "Declared extension"), or
49
+ * `null`. Only the direct declaration — follow the chain with
50
+ * `extendsChain` / `readForSpec`.
51
+ */
52
+ export const EXTENDS: string | null = null;
53
+
54
+ /**
55
+ * Why this version is deprecated, or `null` while it is current. A
56
+ * superseded or retired version is still supported, and is withdrawn from
57
+ * this package in a later scheduled batch (SPEC "Superseded and Withdrawn
58
+ * Versions").
59
+ */
60
+ export const DEPRECATION: string | null = null;
61
+
62
+ /** Stable alias for this specification's request payload shape. */
63
+ export type Payload = VTAContextsDeletePayload;
64
+
65
+ /** Trust Task response type URI (request type URI + "#response"). */
66
+ export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vta/contexts/delete/1.1#response" as const;
67
+
68
+ /** Stable alias for this specification's success-response payload shape. */
69
+ export type Response = VTAContextsDeleteResponsePayload;
70
+
71
+ /**
72
+ * This specification's payload schema, as a value.
73
+ *
74
+ * SPEC.md §7.2 item 2 is performed against this. It is shipped as data
75
+ * rather than only as a `.json` file because TypeScript types are erased
76
+ * at runtime: without a schema a consumer has nothing to validate, and
77
+ * every REQUIRED payload member is optional in practice. Cross-file
78
+ * `$ref`s are already inlined, so it needs no resolver.
79
+ */
80
+ export const PAYLOAD_SCHEMA = {
81
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
82
+ "$id": "https://trusttasks.org/spec/vta/contexts/delete/1.1",
83
+ "title": "VTA Contexts Delete — payload",
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": [
87
+ "id"
88
+ ],
89
+ "properties": {
90
+ "id": {
91
+ "type": "string",
92
+ "minLength": 1,
93
+ "description": "Context to delete."
94
+ },
95
+ "force": {
96
+ "type": "boolean",
97
+ "default": false,
98
+ "description": "Delete even though the context still holds keys, DIDs or templates. Default false, and the default is the point: without it a context holding anything is refused, so the destructive case is always something a caller asked for explicitly."
99
+ },
100
+ "abandonHostCopies": {
101
+ "type": "boolean",
102
+ "default": false,
103
+ "description": "Complete the deletion even where the published log of a `did:webvh` DID in the subtree could not be confirmed removed from its hosting server — the server unreachable, refusing, or no longer known to the VTA. Default false: such a deletion is refused with `vta/contexts/delete:hostCleanupFailed` and nothing is deleted locally, so the caller can wait for the host and retry. True accepts that the named DIDs may keep resolving and that removing them is now the caller's responsibility; each is reported in `daemonCleanupErrors`."
104
+ },
105
+ "ext": {
106
+ "$ref": "#/$defs/Ext"
107
+ }
108
+ },
109
+ "$defs": {
110
+ "Response": {
111
+ "$anchor": "response",
112
+ "title": "VTA Contexts Delete — response payload",
113
+ "description": "Success response to vta/contexts/delete. Type https://trusttasks.org/spec/vta/contexts/delete/1.1#response.",
114
+ "type": "object",
115
+ "additionalProperties": false,
116
+ "required": [
117
+ "id",
118
+ "deleted"
119
+ ],
120
+ "properties": {
121
+ "id": {
122
+ "type": "string"
123
+ },
124
+ "deleted": {
125
+ "type": "boolean",
126
+ "description": "Whether the context was removed. A successful response carrying `false` means the VTA declined to act — it is not an error, and a consumer MUST NOT report the deletion as done on the basis of the response status alone."
127
+ },
128
+ "daemonCleanupErrors": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "string"
132
+ },
133
+ "description": "One entry per `did:webvh` DID in the deleted subtree whose local record was removed while its hosting server did not confirm removal of the published log. **Those DIDs may still resolve.** Only ever present when the request set `abandonHostCopies`; a requester that did not is refused instead. A consumer MUST surface it rather than treating the deletion as complete. Absent or empty means every host copy was confirmed gone."
134
+ },
135
+ "ext": {
136
+ "$ref": "#/$defs/Ext"
137
+ }
138
+ }
139
+ },
140
+ "Ext": {
141
+ "title": "Ext",
142
+ "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.",
143
+ "type": "object",
144
+ "minProperties": 1,
145
+ "additionalProperties": true,
146
+ "propertyNames": {
147
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
148
+ }
149
+ }
150
+ }
151
+ } as const;
152
+
153
+ /** As {@link PAYLOAD_SCHEMA}, for the success-response variant. */
154
+ export const RESPONSE_PAYLOAD_SCHEMA = {
155
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
156
+ "$ref": "#/$defs/Response",
157
+ "$defs": {
158
+ "Response": {
159
+ "$anchor": "response",
160
+ "title": "VTA Contexts Delete — response payload",
161
+ "description": "Success response to vta/contexts/delete. Type https://trusttasks.org/spec/vta/contexts/delete/1.1#response.",
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": [
165
+ "id",
166
+ "deleted"
167
+ ],
168
+ "properties": {
169
+ "id": {
170
+ "type": "string"
171
+ },
172
+ "deleted": {
173
+ "type": "boolean",
174
+ "description": "Whether the context was removed. A successful response carrying `false` means the VTA declined to act — it is not an error, and a consumer MUST NOT report the deletion as done on the basis of the response status alone."
175
+ },
176
+ "daemonCleanupErrors": {
177
+ "type": "array",
178
+ "items": {
179
+ "type": "string"
180
+ },
181
+ "description": "One entry per `did:webvh` DID in the deleted subtree whose local record was removed while its hosting server did not confirm removal of the published log. **Those DIDs may still resolve.** Only ever present when the request set `abandonHostCopies`; a requester that did not is refused instead. A consumer MUST surface it rather than treating the deletion as complete. Absent or empty means every host copy was confirmed gone."
182
+ },
183
+ "ext": {
184
+ "$ref": "#/$defs/Ext"
185
+ }
186
+ }
187
+ },
188
+ "Ext": {
189
+ "title": "Ext",
190
+ "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.",
191
+ "type": "object",
192
+ "minProperties": 1,
193
+ "additionalProperties": true,
194
+ "propertyNames": {
195
+ "pattern": "^[a-z][a-z0-9-]*(\\.[a-z0-9-]+)+$"
196
+ }
197
+ }
198
+ }
199
+ } as const;
200
+
201
+ /**
202
+ * SPEC.md §7.2 policy for the request variant, from this specification's
203
+ * front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
204
+ * per-specification and cannot be derived from the document alone, and
205
+ * item 2 needs the schema this carries.
206
+ */
207
+ export const SPEC = {
208
+ typeUri: TYPE_URI,
209
+ isBearer: false,
210
+ isProofRequired: true,
211
+ isRecipientRequired: true,
212
+ isIssuedAtRequired: true,
213
+ payloadSchema: PAYLOAD_SCHEMA,
214
+ } as const;
215
+
216
+ /**
217
+ * SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
218
+ * tracks the *issuer* party's requirement because a response swaps the
219
+ * parties (§7.3 item 5).
220
+ */
221
+ export const RESPONSE_SPEC = {
222
+ typeUri: RESPONSE_TYPE_URI,
223
+ isBearer: false,
224
+ isProofRequired: true,
225
+ isRecipientRequired: true,
226
+ isIssuedAtRequired: true,
227
+ payloadSchema: RESPONSE_PAYLOAD_SCHEMA,
228
+ } as const;