@openvtc/trust-tasks 0.2.60 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_framework/0.3/framework.d.ts +13 -0
- package/dist/_framework/0.3/framework.d.ts.map +1 -0
- package/dist/_framework/0.3/framework.js +6 -0
- package/dist/_framework/0.3/framework.js.map +1 -0
- package/dist/_runtime/document.d.ts +48 -3
- package/dist/_runtime/document.d.ts.map +1 -1
- package/dist/_runtime/document.js +40 -5
- package/dist/_runtime/document.js.map +1 -1
- package/dist/_runtime/index.d.ts +1 -1
- package/dist/_runtime/index.d.ts.map +1 -1
- package/dist/_runtime/index.js.map +1 -1
- package/dist/audit/list/0.1/payload.d.ts +11 -9
- package/dist/audit/list/0.1/payload.d.ts.map +1 -1
- package/dist/audit/list/0.1/payload.js.map +1 -1
- package/dist/audit/verify/0.1/payload.d.ts +6 -5
- package/dist/audit/verify/0.1/payload.d.ts.map +1 -1
- package/dist/audit/verify/0.1/payload.js.map +1 -1
- package/dist/chat/message/0.1/payload.d.ts +11 -9
- package/dist/chat/message/0.1/payload.d.ts.map +1 -1
- package/dist/chat/message/0.1/payload.js.map +1 -1
- package/dist/consent/request/1.0/payload.d.ts +6 -5
- package/dist/consent/request/1.0/payload.d.ts.map +1 -1
- package/dist/consent/request/1.0/payload.js.map +1 -1
- package/dist/credentials/_shared/0.2/credentials.d.ts +15 -0
- package/dist/credentials/_shared/0.2/credentials.d.ts.map +1 -0
- package/dist/credentials/_shared/0.2/credentials.js +6 -0
- package/dist/credentials/_shared/0.2/credentials.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/policy/evaluate/0.3/payload.d.ts +6 -5
- package/dist/policy/evaluate/0.3/payload.d.ts.map +1 -1
- package/dist/policy/evaluate/0.3/payload.js.map +1 -1
- package/dist/task-consent/decision/0.1/payload.d.ts +11 -9
- package/dist/task-consent/decision/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/decision/0.1/payload.js.map +1 -1
- package/dist/task-consent/granted/0.1/payload.d.ts +6 -5
- package/dist/task-consent/granted/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/granted/0.1/payload.js.map +1 -1
- package/dist/task-consent/request/0.1/payload.d.ts +6 -5
- package/dist/task-consent/request/0.1/payload.d.ts.map +1 -1
- package/dist/task-consent/request/0.1/payload.js.map +1 -1
- package/dist/trust-task-error/0.3/payload.d.ts +60 -0
- package/dist/trust-task-error/0.3/payload.d.ts.map +1 -0
- package/dist/trust-task-error/0.3/payload.js +18 -0
- package/dist/trust-task-error/0.3/payload.js.map +1 -0
- package/dist/vta/credentials/issue/0.1/payload.d.ts +2 -0
- package/dist/vta/credentials/issue/0.1/payload.d.ts.map +1 -1
- package/dist/vta/credentials/issue/0.1/payload.js.map +1 -1
- package/dist/vta/credentials/issue/0.2/payload.d.ts +94 -0
- package/dist/vta/credentials/issue/0.2/payload.d.ts.map +1 -0
- package/dist/vta/credentials/issue/0.2/payload.js +31 -0
- package/dist/vta/credentials/issue/0.2/payload.js.map +1 -0
- package/dist/vtc/relationships/request/0.1/payload.d.ts +65 -0
- package/dist/vtc/relationships/request/0.1/payload.d.ts.map +1 -0
- package/dist/vtc/relationships/request/0.1/payload.js +31 -0
- package/dist/vtc/relationships/request/0.1/payload.js.map +1 -0
- package/package.json +1 -1
- package/src/_framework/0.3/framework.ts +13 -0
- package/src/_runtime/document.ts +80 -6
- package/src/_runtime/index.ts +1 -0
- package/src/audit/list/0.1/payload.ts +12 -9
- package/src/audit/verify/0.1/payload.ts +7 -5
- package/src/chat/message/0.1/payload.ts +12 -9
- package/src/consent/request/1.0/payload.ts +7 -5
- package/src/credentials/_shared/0.2/credentials.ts +15 -0
- package/src/index.ts +5 -0
- package/src/policy/evaluate/0.3/payload.ts +6 -5
- package/src/task-consent/decision/0.1/payload.ts +11 -9
- package/src/task-consent/granted/0.1/payload.ts +7 -5
- package/src/task-consent/request/0.1/payload.ts +7 -5
- package/src/trust-task-error/0.3/payload.ts +80 -0
- package/src/vta/credentials/issue/0.1/payload.ts +2 -0
- package/src/vta/credentials/issue/0.2/payload.ts +101 -0
- package/src/vtc/relationships/request/0.1/payload.ts +71 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/relationships/request/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* A member asks another member to issue them a Verifiable Relationship Credential. Everything here is a hint: the issuing member decides, and declines with a trust-task-error carrying `vtc/relationships/request:declined` rather than a bespoke rejection message.
|
|
7
|
+
*/
|
|
8
|
+
export interface VTCRelationshipsRequestPayload {
|
|
9
|
+
/**
|
|
10
|
+
* Why the requester is asking, in their own words, for the issuing member to weigh. A hint and not a term — the issuing member is under no obligation to honour it, and MUST NOT treat its absence as a defect. Free text reaching a human, so a producer SHOULD keep it to what it is willing to have quoted back.
|
|
11
|
+
*/
|
|
12
|
+
reason?: string;
|
|
13
|
+
ext?: Ext;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 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.
|
|
17
|
+
*/
|
|
18
|
+
export interface Ext {
|
|
19
|
+
[k: string]: unknown | undefined;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The issued credential. Returned only where the issuing member agreed; a decline is a trust-task-error, not a response with an empty field.
|
|
23
|
+
*/
|
|
24
|
+
export interface VTCRelationshipsRequestResponsePayload {
|
|
25
|
+
/**
|
|
26
|
+
* A signed W3C Verifiable Relationship Credential (opaque here). Its issuer MUST be the issuing member — the party that signed this response — and its credentialSubject.id MUST name the requester. The same shape `vtc/relationships/publish` accepts, so a requester can lodge it with the community unchanged.
|
|
27
|
+
*/
|
|
28
|
+
vrc: {};
|
|
29
|
+
/**
|
|
30
|
+
* SHA-256 of the returned VRC, for out-of-band integrity checks. Matches the digest `vtc/relationships/publish` reports once the credential is lodged, so the two can be tied together without re-hashing.
|
|
31
|
+
*/
|
|
32
|
+
vrcSha256?: string;
|
|
33
|
+
ext?: Ext;
|
|
34
|
+
}
|
|
35
|
+
/** Trust Task type URI. */
|
|
36
|
+
export declare const TYPE_URI: "https://trusttasks.org/spec/vtc/relationships/request/0.1";
|
|
37
|
+
/** Stable alias for this specification's request payload shape. */
|
|
38
|
+
export type Payload = VTCRelationshipsRequestPayload;
|
|
39
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
40
|
+
export declare const RESPONSE_TYPE_URI: "https://trusttasks.org/spec/vtc/relationships/request/0.1#response";
|
|
41
|
+
/** Stable alias for this specification's success-response payload shape. */
|
|
42
|
+
export type Response = VTCRelationshipsRequestResponsePayload;
|
|
43
|
+
/**
|
|
44
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
45
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
46
|
+
* per-specification and cannot be derived from the document alone.
|
|
47
|
+
*/
|
|
48
|
+
export declare const SPEC: {
|
|
49
|
+
readonly typeUri: "https://trusttasks.org/spec/vtc/relationships/request/0.1";
|
|
50
|
+
readonly isBearer: false;
|
|
51
|
+
readonly isProofRequired: true;
|
|
52
|
+
readonly isRecipientRequired: true;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
56
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
57
|
+
* parties (§7.3 item 5).
|
|
58
|
+
*/
|
|
59
|
+
export declare const RESPONSE_SPEC: {
|
|
60
|
+
readonly typeUri: "https://trusttasks.org/spec/vtc/relationships/request/0.1#response";
|
|
61
|
+
readonly isBearer: false;
|
|
62
|
+
readonly isProofRequired: true;
|
|
63
|
+
readonly isRecipientRequired: true;
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../../../../src/vtc/relationships/request/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AACD;;GAEG;AACH,MAAM,WAAW,GAAG;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAClC;AACD;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACrD;;OAEG;IACH,GAAG,EAAE,EAAE,CAAC;IACR;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC;CACX;AAED,2BAA2B;AAC3B,eAAO,MAAM,QAAQ,EAAG,2DAAoE,CAAC;AAE7F,mEAAmE;AACnE,MAAM,MAAM,OAAO,GAAG,8BAA8B,CAAC;AAErD,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAG,oEAA6E,CAAC;AAE/G,4EAA4E;AAC5E,MAAM,MAAM,QAAQ,GAAG,sCAAsC,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,IAAI;;;;;CAKP,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/vtc/relationships/request/0.1/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
/** Trust Task type URI. */
|
|
6
|
+
export const TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/request/0.1";
|
|
7
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
8
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/vtc/relationships/request/0.1#response";
|
|
9
|
+
/**
|
|
10
|
+
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
11
|
+
* front matter. Pass to `consumeInbound` — items 5b, 7 and 8 are
|
|
12
|
+
* per-specification and cannot be derived from the document alone.
|
|
13
|
+
*/
|
|
14
|
+
export const SPEC = {
|
|
15
|
+
typeUri: TYPE_URI,
|
|
16
|
+
isBearer: false,
|
|
17
|
+
isProofRequired: true,
|
|
18
|
+
isRecipientRequired: true,
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* SPEC.md §7.2 policy for the success-response variant. `isRecipientRequired`
|
|
22
|
+
* tracks the *issuer* party's requirement because a response swaps the
|
|
23
|
+
* parties (§7.3 item 5).
|
|
24
|
+
*/
|
|
25
|
+
export const RESPONSE_SPEC = {
|
|
26
|
+
typeUri: RESPONSE_TYPE_URI,
|
|
27
|
+
isBearer: false,
|
|
28
|
+
isProofRequired: true,
|
|
29
|
+
isRecipientRequired: true,
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=payload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../../../../src/vtc/relationships/request/0.1/payload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiCH,2BAA2B;AAC3B,MAAM,CAAC,MAAM,QAAQ,GAAG,2DAAoE,CAAC;AAK7F,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,oEAA6E,CAAC;AAK/G;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;CACjB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,IAAI;IACrB,mBAAmB,EAAE,IAAI;CACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/_framework/0.3/framework.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Reusable $defs cross-referenced by individual Trust Task specifications. Not itself a Trust Task specification — the `_framework` directory is skipped by the registry build (folders starting with `_` are not discovered) and by the codegen (which only triggers on payload.schema.json). See SPEC.md §4.5.1 for the normative description of `ext`.
|
|
8
|
+
*
|
|
9
|
+
* Additive over 0.2: `Ext` is carried forward unchanged, and `DigestMultibase` is new. Specifications pinned to 0.2 remain valid; a draft specification re-pinning to 0.3 does so in place, errata-style, per SPEC.md §5.2 — the re-pin does not change any payload's effective wire shape.
|
|
10
|
+
*/
|
|
11
|
+
export interface TrustTasksFrameworkReusableJSONSchemaDefinitions {
|
|
12
|
+
[k: string]: unknown | undefined;
|
|
13
|
+
}
|
package/src/_runtime/document.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Hand-written. Mirrors `document.rs` in trust-tasks-rs.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type
|
|
8
|
+
import { normalizeCode, type StandardCode } from "./codes.js";
|
|
9
9
|
|
|
10
10
|
/** A W3C Data Integrity Proof object (SPEC.md §4.7). Opaque to the framework. */
|
|
11
11
|
export interface Proof {
|
|
@@ -24,6 +24,17 @@ export interface TrustTaskDocument<P> {
|
|
|
24
24
|
id: string;
|
|
25
25
|
/** Correlates this document with others in the same exchange (§4.9). */
|
|
26
26
|
threadId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The `threadId` of the exchange containing this one, where this exchange is
|
|
29
|
+
* conducted inside another (§4.9.2).
|
|
30
|
+
*
|
|
31
|
+
* A navigation aid. It records one level of containment and does **not**
|
|
32
|
+
* change which exchange attests an event — §4.9.1 governs that, and holds
|
|
33
|
+
* whether or not this member is present. Like `threadId` it carries no
|
|
34
|
+
* normative validation semantics: a consumer MUST NOT reject a document on
|
|
35
|
+
* the basis of `parentThreadId` alone.
|
|
36
|
+
*/
|
|
37
|
+
parentThreadId?: string;
|
|
27
38
|
/** The Type URI identifying specification and version (§4.4). */
|
|
28
39
|
type: string;
|
|
29
40
|
/** VID of the party responsible for the content (§4.8). */
|
|
@@ -43,9 +54,37 @@ export interface TrustTaskDocument<P> {
|
|
|
43
54
|
[k: string]: unknown;
|
|
44
55
|
}
|
|
45
56
|
|
|
57
|
+
/** Names the Trust Task document an {@link ErrorPayload} reports on (§8.2). */
|
|
58
|
+
export interface InResponseTo {
|
|
59
|
+
/**
|
|
60
|
+
* The reported-on document's `type`, including any `#request` / `#response`
|
|
61
|
+
* fragment — that fragment is what tells a consumer which variant's semantics
|
|
62
|
+
* apply.
|
|
63
|
+
*/
|
|
64
|
+
typeUri: string;
|
|
65
|
+
/**
|
|
66
|
+
* The reported-on document's `id`. Globally unique and never reused (§4.3),
|
|
67
|
+
* so it names one instance where `threadId` names an exchange.
|
|
68
|
+
*
|
|
69
|
+
* Omitted under `identityMismatch`: per §8.1 the response goes to the
|
|
70
|
+
* transport-authenticated sender rather than the in-band `issuer`, and that
|
|
71
|
+
* party did not necessarily compose the document.
|
|
72
|
+
*/
|
|
73
|
+
id?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
46
76
|
/** The `payload` of an error response (SPEC.md §8.2). */
|
|
47
77
|
export interface ErrorPayload {
|
|
48
78
|
code: string;
|
|
79
|
+
/**
|
|
80
|
+
* Identifies the document this error reports on (§8.2).
|
|
81
|
+
*
|
|
82
|
+
* `threadId` correlates the exchange for a party that saw the request and
|
|
83
|
+
* identifies nothing to anyone else, so without this a retained error names
|
|
84
|
+
* neither the specification the failure occurred under nor the instance. The
|
|
85
|
+
* builders below populate it.
|
|
86
|
+
*/
|
|
87
|
+
inResponseTo?: InResponseTo;
|
|
49
88
|
message?: string;
|
|
50
89
|
retryable: boolean;
|
|
51
90
|
retryAfter?: string;
|
|
@@ -81,8 +120,15 @@ export interface RejectReason {
|
|
|
81
120
|
details?: Record<string, unknown>;
|
|
82
121
|
}
|
|
83
122
|
|
|
84
|
-
/**
|
|
85
|
-
|
|
123
|
+
/**
|
|
124
|
+
* The Type URI a consumer emits error responses under.
|
|
125
|
+
*
|
|
126
|
+
* `0.3`, because this runtime populates the `inResponseTo` member of §8.2 and
|
|
127
|
+
* `0.2`'s payload schema is `additionalProperties: false` — a document carrying
|
|
128
|
+
* it would not validate as `0.2`. Per §5.2 forward-minor compatibility a `0.2`
|
|
129
|
+
* consumer SHOULD accept it.
|
|
130
|
+
*/
|
|
131
|
+
export const TRUST_TASK_ERROR_TYPE_URI = "https://trusttasks.org/spec/trust-task-error/0.3";
|
|
86
132
|
|
|
87
133
|
/**
|
|
88
134
|
* SPEC §7.2 items 4 and 5a — expiry and wrong-recipient.
|
|
@@ -194,7 +240,23 @@ export function rejectWithRecipient<P>(
|
|
|
194
240
|
recipient: string | undefined,
|
|
195
241
|
now: () => string = () => new Date().toISOString(),
|
|
196
242
|
): ErrorResponse {
|
|
197
|
-
|
|
243
|
+
// §8.2 — name the document this error reports on, so it means something to a
|
|
244
|
+
// party that did not see the request. Filled here rather than left to the
|
|
245
|
+
// caller because the builder is the only place that reliably has the
|
|
246
|
+
// originating document in hand; a caller-supplied value is kept.
|
|
247
|
+
const withOrigin: ErrorPayload = { ...payload };
|
|
248
|
+
if (withOrigin.inResponseTo === undefined) {
|
|
249
|
+
const about: InResponseTo = { typeUri: request.type };
|
|
250
|
+
// §8.1/§8.2 — under identityMismatch the response is addressed to the
|
|
251
|
+
// transport-authenticated sender, not the in-band issuer. That party did
|
|
252
|
+
// not necessarily compose the document, so its id is not echoed back.
|
|
253
|
+
if (normalizeCode(payload.code) !== "identityMismatch") {
|
|
254
|
+
about.id = request.id;
|
|
255
|
+
}
|
|
256
|
+
withOrigin.inResponseTo = about;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const response: ErrorResponse = {
|
|
198
260
|
id,
|
|
199
261
|
// §4.9: continue the thread, falling back to the request's own id.
|
|
200
262
|
threadId: request.threadId ?? request.id,
|
|
@@ -202,8 +264,15 @@ export function rejectWithRecipient<P>(
|
|
|
202
264
|
issuer: request.recipient,
|
|
203
265
|
recipient,
|
|
204
266
|
issuedAt: now(),
|
|
205
|
-
payload,
|
|
267
|
+
payload: withOrigin,
|
|
206
268
|
};
|
|
269
|
+
// §4.9.2 — the whole exchange shares one parent, so the error response stays
|
|
270
|
+
// inside the same enclosing exchange. Assigned conditionally so an absent
|
|
271
|
+
// parent does not become an explicit `undefined` on the wire.
|
|
272
|
+
if (request.parentThreadId !== undefined) {
|
|
273
|
+
response.parentThreadId = request.parentThreadId;
|
|
274
|
+
}
|
|
275
|
+
return response;
|
|
207
276
|
}
|
|
208
277
|
|
|
209
278
|
/**
|
|
@@ -247,7 +316,7 @@ export function respondWith<P, R>(
|
|
|
247
316
|
now: () => string = () => new Date().toISOString(),
|
|
248
317
|
): TrustTaskDocument<R> {
|
|
249
318
|
const bare = request.type.split("#")[0]!;
|
|
250
|
-
|
|
319
|
+
const response: TrustTaskDocument<R> = {
|
|
251
320
|
id,
|
|
252
321
|
threadId: request.threadId ?? request.id,
|
|
253
322
|
type: `${bare}#response`,
|
|
@@ -256,4 +325,9 @@ export function respondWith<P, R>(
|
|
|
256
325
|
issuedAt: now(),
|
|
257
326
|
payload,
|
|
258
327
|
};
|
|
328
|
+
// §4.9.2 — the whole exchange shares one parent.
|
|
329
|
+
if (request.parentThreadId !== undefined) {
|
|
330
|
+
response.parentThreadId = request.parentThreadId;
|
|
331
|
+
}
|
|
332
|
+
return response;
|
|
259
333
|
}
|
package/src/_runtime/index.ts
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
* Source: specs/audit/list/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Hash-chain link: the `entryHash` of the immediately-preceding entry. Present only on chained logs; its integrity is what audit/verify checks. Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the predecessor's immutable content — the same derivation as `entryHash`, so a verifier recomputes both the same way.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
/**
|
|
11
|
+
* Hash-chain commitment over this entry's immutable content. The next entry's `prevHash` points here. Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of that content; the canonicalization is what makes the commitment reproducible by a verifier that did not write the entry.
|
|
12
|
+
*/
|
|
13
|
+
export type DigestMultibase1 = string;
|
|
14
|
+
|
|
6
15
|
export interface AuditListPayload {
|
|
7
16
|
/**
|
|
8
17
|
* Return only entries recorded at or after this time.
|
|
@@ -95,14 +104,8 @@ export interface AuditEnvelope {
|
|
|
95
104
|
* Envelope-shape version at the maintainer, for consumers that need to reason about wire-shape evolution.
|
|
96
105
|
*/
|
|
97
106
|
schemaVersion?: number;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*/
|
|
101
|
-
prevHash?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Hash-chain commitment over this entry's immutable content. The next entry's `prevHash` points here.
|
|
104
|
-
*/
|
|
105
|
-
entryHash?: string;
|
|
107
|
+
prevHash?: DigestMultibase;
|
|
108
|
+
entryHash?: DigestMultibase1;
|
|
106
109
|
/**
|
|
107
110
|
* Event-specific payload, keyed by `action`. Opaque to the framework; a consumer that does not recognise the action treats it as an unstructured record.
|
|
108
111
|
*/
|
|
@@ -116,7 +119,7 @@ export interface AuditEnvelope {
|
|
|
116
119
|
export const TYPE_URI = "https://trusttasks.org/spec/audit/list/0.1" as const;
|
|
117
120
|
|
|
118
121
|
/** Stable alias for this specification's request payload shape. */
|
|
119
|
-
export type Payload =
|
|
122
|
+
export type Payload = DigestMultibase;
|
|
120
123
|
|
|
121
124
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
122
125
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/audit/list/0.1#response" as const;
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* Source: specs/audit/verify/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The `entryHash` of the newest envelope reached, in the same multibase-multihash encoding the envelope carries it. Absent when the log is empty.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Request to verify the integrity of a maintainer's append-only audit hash chain. The request carries no parameters — verification is store-wide.
|
|
8
13
|
*/
|
|
@@ -39,10 +44,7 @@ export interface AuditVerifyResponsePayload {
|
|
|
39
44
|
* Envelopes that could not be deserialized and so could not be checked. Reported at the same prominence as a break, not swallowed.
|
|
40
45
|
*/
|
|
41
46
|
unparseableSkipped: number;
|
|
42
|
-
|
|
43
|
-
* Hex `entryHash` of the newest envelope reached. Absent when the log is empty.
|
|
44
|
-
*/
|
|
45
|
-
head?: string;
|
|
47
|
+
head?: DigestMultibase;
|
|
46
48
|
chainBreak?: ChainBreak;
|
|
47
49
|
ext?: Ext;
|
|
48
50
|
}
|
|
@@ -68,7 +70,7 @@ export interface ChainBreak {
|
|
|
68
70
|
export const TYPE_URI = "https://trusttasks.org/spec/audit/verify/0.1" as const;
|
|
69
71
|
|
|
70
72
|
/** Stable alias for this specification's request payload shape. */
|
|
71
|
-
export type Payload =
|
|
73
|
+
export type Payload = DigestMultibase;
|
|
72
74
|
|
|
73
75
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
74
76
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/audit/verify/0.1#response" as const;
|
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
* Source: specs/chat/message/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* OPTIONAL. Multibase-encoded multihash over the attachment bytes, so the reference is itself verifiable and tamper-evident. Taken over the bytes as transferred, not over any JSON wrapper.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
/**
|
|
11
|
+
* Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the previous document, so a gap, reorder, or removal in the chain is detectable. The algorithm travels in the multihash rather than being fixed here.
|
|
12
|
+
*/
|
|
13
|
+
export type DigestMultibase1 = string;
|
|
14
|
+
|
|
6
15
|
/**
|
|
7
16
|
* A conversational message exchanged between an AI agent and a messaging-platform bridge. Signed by its author (via the document `proof`) and hash-linked to the previous message in the conversation (`prev`), so a third party can verify each message's author and ordering after the transport has closed — for audit and dispute resolution. Conversations and contacts are referenced by opaque, bridge-issued handles, never raw platform addresses.
|
|
8
17
|
*/
|
|
@@ -85,10 +94,7 @@ export interface AttachmentRef {
|
|
|
85
94
|
* OPTIONAL. Size in bytes, if known ahead of fetch.
|
|
86
95
|
*/
|
|
87
96
|
sizeBytes?: number;
|
|
88
|
-
|
|
89
|
-
* OPTIONAL. Multihash digest of the attachment bytes, so the reference is itself verifiable and tamper-evident.
|
|
90
|
-
*/
|
|
91
|
-
digest?: string;
|
|
97
|
+
digest?: DigestMultibase;
|
|
92
98
|
}
|
|
93
99
|
/**
|
|
94
100
|
* OPTIONAL on the first message in a conversation; present on every message thereafter. Links to the previous message so the conversation forms a verifiable, ordered chain.
|
|
@@ -98,10 +104,7 @@ export interface ChainLink {
|
|
|
98
104
|
* The `id` of the previous `chat/message` Trust Task document in this conversation.
|
|
99
105
|
*/
|
|
100
106
|
id: string;
|
|
101
|
-
|
|
102
|
-
* Multihash digest (e.g. `sha-256`) over the previous document, so a gap, reorder, or removal in the chain is detectable.
|
|
103
|
-
*/
|
|
104
|
-
digest: string;
|
|
107
|
+
digest: DigestMultibase1;
|
|
105
108
|
}
|
|
106
109
|
/**
|
|
107
110
|
* 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.
|
|
@@ -114,7 +117,7 @@ export interface Ext {
|
|
|
114
117
|
export const TYPE_URI = "https://trusttasks.org/spec/chat/message/0.1" as const;
|
|
115
118
|
|
|
116
119
|
/** Stable alias for this specification's request payload shape. */
|
|
117
|
-
export type Payload =
|
|
120
|
+
export type Payload = DigestMultibase;
|
|
118
121
|
|
|
119
122
|
/**
|
|
120
123
|
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* Source: specs/consent/request/1.0/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Optional multibase-encoded multihash over the rfc 8785 (jcs) canonicalization of the held first message, binding the request to concrete content.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* A bridge asks the VTA whether an inbound conversation may reach an AI agent, prompting operator consent on first contact.
|
|
8
13
|
*/
|
|
@@ -20,10 +25,7 @@ export interface ConsentRequestPayload {
|
|
|
20
25
|
* Optional operator-facing label (e.g. "Signal group 'Family'"). MUST NOT contain a raw platform address.
|
|
21
26
|
*/
|
|
22
27
|
displayHint?: string;
|
|
23
|
-
|
|
24
|
-
* Optional multihash digest of the held first message, binding the request to concrete content.
|
|
25
|
-
*/
|
|
26
|
-
firstMessageDigest?: string;
|
|
28
|
+
firstMessageDigest?: DigestMultibase;
|
|
27
29
|
/**
|
|
28
30
|
* Optional VTA context path the bridge runs under, to scope approver resolution.
|
|
29
31
|
*/
|
|
@@ -80,7 +82,7 @@ export interface ConsentRequestResponsePayload {
|
|
|
80
82
|
export const TYPE_URI = "https://trusttasks.org/spec/consent/request/1.0" as const;
|
|
81
83
|
|
|
82
84
|
/** Stable alias for this specification's request payload shape. */
|
|
83
|
-
export type Payload =
|
|
85
|
+
export type Payload = DigestMultibase;
|
|
84
86
|
|
|
85
87
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
86
88
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/consent/request/1.0#response" as const;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/credentials/_shared/0.2/credentials.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The credential-minting core shared by every family that issues or revokes a Verifiable Credential (vta/credentials/*, vtc/endorsements/*, and future issuers). A family embeds these definitions rather than restating them, so the issuance receipt and the revocation receipt have one canonical shape across the registry. Families remain separate Trust Tasks because their trust semantics differ (approval plane, third-party verifiability, governance gating); only the mechanism is shared.
|
|
8
|
+
*
|
|
9
|
+
* Two levels of reuse are offered. A family whose response IS a receipt embeds `IssuedCredential` / `RevocationReceipt` whole, as vtc/endorsements does. A family whose response carries additional members alongside the receipt fields cannot do that — these definitions are `additionalProperties: false`, so composing one via `allOf` would reject the extra members — and instead references `CredentialId`, the identifier both receipts are keyed by, as vta/credentials does.
|
|
10
|
+
*
|
|
11
|
+
* `CredentialId` is hoisted and the other members are not, deliberately: it is the one field carrying a constraint worth stating once (non-empty), and the code generators mint a named type per `$def`, so hoisting a plain timestamp or the opaque credential object would wrap `expiresAt` and `credential` in newtypes for every consumer while deduplicating nothing but a description.
|
|
12
|
+
*/
|
|
13
|
+
export interface CredentialsSharedIssuanceAndRevocationDefinitions {
|
|
14
|
+
[k: string]: unknown | undefined;
|
|
15
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./_runtime/index.js";
|
|
|
7
7
|
|
|
8
8
|
export * as FrameworkShared_v0_1 from "./_framework/0.1/framework.js";
|
|
9
9
|
export * as FrameworkShared_v0_2 from "./_framework/0.2/framework.js";
|
|
10
|
+
export * as FrameworkShared_v0_3 from "./_framework/0.3/framework.js";
|
|
10
11
|
export * as AclEntryShared_v0_1 from "./acl/_shared/0.1/acl-entry.js";
|
|
11
12
|
export * as AclChangeRole_v0_1 from "./acl/change-role/0.1/payload.js";
|
|
12
13
|
export * as AclGrant_v0_1 from "./acl/grant/0.1/payload.js";
|
|
@@ -70,6 +71,7 @@ export * as CredentialExchangePresent_v0_1 from "./credential-exchange/present/0
|
|
|
70
71
|
export * as CredentialExchangeQuery_v0_1 from "./credential-exchange/query/0.1/payload.js";
|
|
71
72
|
export * as CredentialExchangeRequest_v0_1 from "./credential-exchange/request/0.1/payload.js";
|
|
72
73
|
export * as CredentialsShared_v0_1 from "./credentials/_shared/0.1/credentials.js";
|
|
74
|
+
export * as CredentialsShared_v0_2 from "./credentials/_shared/0.2/credentials.js";
|
|
73
75
|
export * as DeviceBindingShared_v0_1 from "./device/_shared/0.1/device-binding.js";
|
|
74
76
|
export * as DeviceBindingShared_v0_2 from "./device/_shared/0.2/device-binding.js";
|
|
75
77
|
export * as DeviceDisable_v0_1 from "./device/disable/0.1/payload.js";
|
|
@@ -204,6 +206,7 @@ export * as TaskConsentRequest_v0_1 from "./task-consent/request/0.1/payload.js"
|
|
|
204
206
|
export * as TrustTaskDiscovery_v0_1 from "./trust-task-discovery/0.1/payload.js";
|
|
205
207
|
export * as TrustTaskError_v0_1 from "./trust-task-error/0.1/payload.js";
|
|
206
208
|
export * as TrustTaskError_v0_2 from "./trust-task-error/0.2/payload.js";
|
|
209
|
+
export * as TrustTaskError_v0_3 from "./trust-task-error/0.3/payload.js";
|
|
207
210
|
export * as ConsumerContextShared_v0_1 from "./vault/_shared/0.1/consumer-context.js";
|
|
208
211
|
export * as SealedEnvelopeShared_v0_1 from "./vault/_shared/0.1/sealed-envelope.js";
|
|
209
212
|
export * as SessionBlobShared_v0_1 from "./vault/_shared/0.1/session-blob.js";
|
|
@@ -240,6 +243,7 @@ export * as VtaContextsDidTemplatesList_v1_0 from "./vta/contexts/did-templates/
|
|
|
240
243
|
export * as VtaContextsDidTemplatesRender_v1_0 from "./vta/contexts/did-templates/render/1.0/payload.js";
|
|
241
244
|
export * as VtaContextsDidTemplatesUpdate_v1_0 from "./vta/contexts/did-templates/update/1.0/payload.js";
|
|
242
245
|
export * as VtaCredentialsIssue_v0_1 from "./vta/credentials/issue/0.1/payload.js";
|
|
246
|
+
export * as VtaCredentialsIssue_v0_2 from "./vta/credentials/issue/0.2/payload.js";
|
|
243
247
|
export * as VtaCredentialsRevoke_v0_1 from "./vta/credentials/revoke/0.1/payload.js";
|
|
244
248
|
export * as VtaDidTemplatesCreate_v1_0 from "./vta/did-templates/create/1.0/payload.js";
|
|
245
249
|
export * as VtaDidTemplatesCreate_v2_0 from "./vta/did-templates/create/2.0/payload.js";
|
|
@@ -331,6 +335,7 @@ export * as VtcRegistryDiagnostics_v0_1 from "./vtc/registry/diagnostics/0.1/pay
|
|
|
331
335
|
export * as VtcRelationshipsGraph_v0_1 from "./vtc/relationships/graph/0.1/payload.js";
|
|
332
336
|
export * as VtcRelationshipsList_v0_1 from "./vtc/relationships/list/0.1/payload.js";
|
|
333
337
|
export * as VtcRelationshipsPublish_v0_1 from "./vtc/relationships/publish/0.1/payload.js";
|
|
338
|
+
export * as VtcRelationshipsRequest_v0_1 from "./vtc/relationships/request/0.1/payload.js";
|
|
334
339
|
export * as VtcRelationshipsRevoke_v0_1 from "./vtc/relationships/revoke/0.1/payload.js";
|
|
335
340
|
export * as VtcWebsiteFilesDelete_v0_1 from "./vtc/website/files/delete/0.1/payload.js";
|
|
336
341
|
export * as VtcWebsiteFilesList_v0_1 from "./vtc/website/files/list/0.1/payload.js";
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* Source: specs/policy/evaluate/0.3/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the payload, salted with the request challenge, present when a delegated-execution consent flow must bind approval to this exact payload. Absent when no consent binding is in play.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
6
10
|
/**
|
|
7
11
|
* A single binding target for a vault entry. Tagged union over the discriminator `kind`. A VaultEntry's `targets` array MAY mix any number of these.
|
|
8
12
|
*/
|
|
@@ -42,10 +46,7 @@ export interface PolicyInput {
|
|
|
42
46
|
* The identifier the task acts on — the value at the spec's `subjectPath` (usually a DID). The evaluator checks the consumer's authority to act on this subject. Absent for subjectless tasks (discovery, list).
|
|
43
47
|
*/
|
|
44
48
|
subject?: string;
|
|
45
|
-
|
|
46
|
-
* Multihash of the canonicalized payload, salted with the request challenge, present when a delegated-execution consent flow must bind approval to this exact payload. Absent when no consent binding is in play.
|
|
47
|
-
*/
|
|
48
|
-
payloadDigest?: string;
|
|
49
|
+
payloadDigest?: DigestMultibase;
|
|
49
50
|
/**
|
|
50
51
|
* Authoritative integrity class (SPEC §7.3 item 13). The evaluator MUST derive this from the compiled handler it is about to invoke, not from the wire — the registry's declared value is advisory only.
|
|
51
52
|
*/
|
|
@@ -176,7 +177,7 @@ export interface PolicyDecision {
|
|
|
176
177
|
export const TYPE_URI = "https://trusttasks.org/spec/policy/evaluate/0.3" as const;
|
|
177
178
|
|
|
178
179
|
/** Stable alias for this specification's request payload shape. */
|
|
179
|
-
export type Payload =
|
|
180
|
+
export type Payload = DigestMultibase;
|
|
180
181
|
|
|
181
182
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
182
183
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/policy/evaluate/0.3#response" as const;
|
|
@@ -3,10 +3,18 @@
|
|
|
3
3
|
* Source: specs/task-consent/decision/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Echoes the digest of the task being authorized, in the encoding `task-consent/request` carried it. The executor re-derives it from the payload it is about to execute and refuses on mismatch — this is what makes the approved payload the executed payload, cryptographically rather than by convention.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
6
10
|
/**
|
|
7
11
|
* The approver's answer. `deny` aborts the pending request; a subsequent submit of the same task starts a fresh one.
|
|
8
12
|
*/
|
|
9
13
|
export type Decision = "approve" | "deny";
|
|
14
|
+
/**
|
|
15
|
+
* The digest this decision concerned, in the encoding `task-consent/request` carried it.
|
|
16
|
+
*/
|
|
17
|
+
export type DigestMultibase1 = string;
|
|
10
18
|
|
|
11
19
|
/**
|
|
12
20
|
* An enrolled approver authorizes (or refuses) one pending privileged task, bound to the exact payload it was shown. The proof on this document — not the transport session that carried it — is the authorization.
|
|
@@ -16,10 +24,7 @@ export interface TaskConsentDecisionPayload {
|
|
|
16
24
|
* Echoes the task-consent/request this decision answers, binding it to that one pending request. An executor MUST consume the challenge at execution rather than on receipt of this decision: a decision authorizes exactly one execution, and consuming it earlier lets an executor's own retry legitimately replay it.
|
|
17
25
|
*/
|
|
18
26
|
challenge: string;
|
|
19
|
-
|
|
20
|
-
* Echoes the digest of the task being authorized. The executor re-derives it from the payload it is about to execute and refuses on mismatch — this is what makes the approved payload the executed payload, cryptographically rather than by convention.
|
|
21
|
-
*/
|
|
22
|
-
payloadDigest: string;
|
|
27
|
+
payloadDigest: DigestMultibase;
|
|
23
28
|
decision: Decision;
|
|
24
29
|
/**
|
|
25
30
|
* OPTIONAL human-facing note, most useful on a `deny`.
|
|
@@ -41,10 +46,7 @@ export interface TaskConsentDecisionResponsePayload {
|
|
|
41
46
|
* `granted` = the threshold is met and the requester's re-submit will now execute. `pending` = the approval was recorded but more are needed. `denied` = the request was aborted.
|
|
42
47
|
*/
|
|
43
48
|
status: "granted" | "pending" | "denied";
|
|
44
|
-
|
|
45
|
-
* The digest this decision concerned.
|
|
46
|
-
*/
|
|
47
|
-
payloadDigest: string;
|
|
49
|
+
payloadDigest: DigestMultibase1;
|
|
48
50
|
/**
|
|
49
51
|
* Distinct approvals recorded so far.
|
|
50
52
|
*/
|
|
@@ -60,7 +62,7 @@ export interface TaskConsentDecisionResponsePayload {
|
|
|
60
62
|
export const TYPE_URI = "https://trusttasks.org/spec/task-consent/decision/0.1" as const;
|
|
61
63
|
|
|
62
64
|
/** Stable alias for this specification's request payload shape. */
|
|
63
|
-
export type Payload =
|
|
65
|
+
export type Payload = DigestMultibase;
|
|
64
66
|
|
|
65
67
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
66
68
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/task-consent/decision/0.1#response" as const;
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* Source: specs/task-consent/granted/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The salted wire digest of the approved task — the same value the matching task-consent/request carried and the decision echoed. The requester already holds it; it is repeated here only so the requester can correlate the notice to the pending task it should now re-submit. It confers nothing: the executor's single-use grant lookup at re-submit is the authorization.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Fire-and-forget notice from the executor to the requester that its pending task has reached the approval threshold and a single-use grant is waiting, so the requester re-submits at once instead of polling. Non-load-bearing by design: the grant check at re-submit is the real gate, so a lost or spurious notice costs at most one poll cycle.
|
|
8
13
|
*/
|
|
@@ -11,10 +16,7 @@ export interface TaskConsentGrantedPayload {
|
|
|
11
16
|
* Always `granted`. A denial sends no notice — the requester's re-submit discovers it, and a notice that could carry a denial would tempt a consumer into treating this advisory channel as the authoritative outcome, which it is not.
|
|
12
17
|
*/
|
|
13
18
|
status: "granted";
|
|
14
|
-
|
|
15
|
-
* The salted wire digest of the approved task — the same value the matching task-consent/request carried and the decision echoed. The requester already holds it; it is repeated here only so the requester can correlate the notice to the pending task it should now re-submit. It confers nothing: the executor's single-use grant lookup at re-submit is the authorization.
|
|
16
|
-
*/
|
|
17
|
-
payloadDigest: string;
|
|
19
|
+
payloadDigest: DigestMultibase;
|
|
18
20
|
/**
|
|
19
21
|
* Type URI of the approved task, for correlation and display at the requester. Advisory on the same terms as the digest — the executor re-derives everything it enforces from the re-submitted payload itself.
|
|
20
22
|
*/
|
|
@@ -32,7 +34,7 @@ export interface Ext {
|
|
|
32
34
|
export const TYPE_URI = "https://trusttasks.org/spec/task-consent/granted/0.1" as const;
|
|
33
35
|
|
|
34
36
|
/** Stable alias for this specification's request payload shape. */
|
|
35
|
-
export type Payload =
|
|
37
|
+
export type Payload = DigestMultibase;
|
|
36
38
|
|
|
37
39
|
/**
|
|
38
40
|
* SPEC.md §7.2 policy for the request variant, from this specification's
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* Source: specs/task-consent/request/0.1/payload.schema.json
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The binding between what the approver sees and what executes. Multibase-encoded multihash over the RFC 8785 (JCS) canonicalization of the payload, the task type, and the `challenge` as salt. The decision echoes it; the executor re-derives it from the payload it is about to run and refuses on mismatch. Salted because an unsalted digest over a low-entropy payload is a confirmation oracle for anyone who observes it in transit.
|
|
8
|
+
*/
|
|
9
|
+
export type DigestMultibase = string;
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* The executor asks an enrolled approver device to authorize one pending privileged task, presenting the effects it computed by dry-running the real handler against its own prior state. The executor signs this document; the approver renders only what it verifies under that signature.
|
|
8
13
|
*/
|
|
@@ -15,10 +20,7 @@ export interface TaskConsentRequestPayload {
|
|
|
15
20
|
* Type URI of the task awaiting approval. It is bound into `payloadDigest`: without that binding, two tasks whose payloads canonicalize identically would share a digest, and an approval for a benign task would authorize a destructive one.
|
|
16
21
|
*/
|
|
17
22
|
taskType: string;
|
|
18
|
-
|
|
19
|
-
* The binding between what the approver sees and what executes. Digest of the canonical (RFC 8785 JCS) payload, the task type, and the `challenge` as salt. The decision echoes it; the executor re-derives it from the payload it is about to run and refuses on mismatch. Salted because an unsalted digest over a low-entropy payload is a confirmation oracle for anyone who observes it in transit.
|
|
20
|
-
*/
|
|
21
|
-
payloadDigest: string;
|
|
23
|
+
payloadDigest: DigestMultibase;
|
|
22
24
|
/**
|
|
23
25
|
* Authoritative SPEC §7.3 item 13 side-effect class of the pending task, derived by the executor from the compiled handler it is about to invoke. NEVER taken from the registry: a registry that decided this would be a consent kill-switch, downgradeable by publishing a new version with a weaker class.
|
|
24
26
|
*/
|
|
@@ -157,7 +159,7 @@ export interface TaskConsentRequestResponsePayload {
|
|
|
157
159
|
export const TYPE_URI = "https://trusttasks.org/spec/task-consent/request/0.1" as const;
|
|
158
160
|
|
|
159
161
|
/** Stable alias for this specification's request payload shape. */
|
|
160
|
-
export type Payload =
|
|
162
|
+
export type Payload = DigestMultibase;
|
|
161
163
|
|
|
162
164
|
/** Trust Task response type URI (request type URI + "#response"). */
|
|
163
165
|
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/task-consent/request/0.1#response" as const;
|