@openvtc/trust-tasks 0.2.1 → 0.2.2
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/package.json +1 -1
- package/src/chat/message/1.0/payload.ts +87 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by scripts/build-ts-bindings.mjs — DO NOT EDIT BY HAND.
|
|
3
|
+
* Source: specs/chat/message/1.0/payload.schema.json
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* 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
|
+
*/
|
|
9
|
+
export interface ChatMessagePayload {
|
|
10
|
+
/**
|
|
11
|
+
* Opaque, bridge-issued conversation handle. MUST NOT be a raw platform address (phone number, chat id).
|
|
12
|
+
*/
|
|
13
|
+
conversationId: string;
|
|
14
|
+
/**
|
|
15
|
+
* `inbound` = platform → agent (the bridge attests what it received and normalized); `outbound` = agent → platform (authored by the agent).
|
|
16
|
+
*/
|
|
17
|
+
direction: "inbound" | "outbound";
|
|
18
|
+
/**
|
|
19
|
+
* OPTIONAL. Platform key the message belongs to (e.g. `signal`, `whatsapp`). Advisory.
|
|
20
|
+
*/
|
|
21
|
+
platform?: string;
|
|
22
|
+
/**
|
|
23
|
+
* OPTIONAL. Plain-text body. Absent for attachment-only messages.
|
|
24
|
+
*/
|
|
25
|
+
text?: string;
|
|
26
|
+
/**
|
|
27
|
+
* OPTIONAL. Attachments carried by reference, never inline.
|
|
28
|
+
*/
|
|
29
|
+
attachments?: AttachmentRef[];
|
|
30
|
+
/**
|
|
31
|
+
* OPTIONAL. The `id` of the message this one replies to.
|
|
32
|
+
*/
|
|
33
|
+
replyToId?: string;
|
|
34
|
+
prev?: ChainLink;
|
|
35
|
+
/**
|
|
36
|
+
* RFC 3339 timestamp the author asserts for this message.
|
|
37
|
+
*/
|
|
38
|
+
sentAt: string;
|
|
39
|
+
ext?: Ext;
|
|
40
|
+
}
|
|
41
|
+
export interface AttachmentRef {
|
|
42
|
+
/**
|
|
43
|
+
* Opaque attachment id, resolvable via the bridge's attachment fetch.
|
|
44
|
+
*/
|
|
45
|
+
id: string;
|
|
46
|
+
/**
|
|
47
|
+
* OPTIONAL. Suggested filename.
|
|
48
|
+
*/
|
|
49
|
+
filename?: string;
|
|
50
|
+
/**
|
|
51
|
+
* IANA media type (e.g. `image/jpeg`).
|
|
52
|
+
*/
|
|
53
|
+
mediaType: string;
|
|
54
|
+
/**
|
|
55
|
+
* OPTIONAL. Size in bytes, if known ahead of fetch.
|
|
56
|
+
*/
|
|
57
|
+
sizeBytes?: number;
|
|
58
|
+
/**
|
|
59
|
+
* OPTIONAL. Multihash digest of the attachment bytes, so the reference is itself verifiable and tamper-evident.
|
|
60
|
+
*/
|
|
61
|
+
digest?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 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.
|
|
65
|
+
*/
|
|
66
|
+
export interface ChainLink {
|
|
67
|
+
/**
|
|
68
|
+
* The `id` of the previous `chat/message` Trust Task document in this conversation.
|
|
69
|
+
*/
|
|
70
|
+
id: string;
|
|
71
|
+
/**
|
|
72
|
+
* Multihash digest (e.g. `sha-256`) over the previous document, so a gap, reorder, or removal in the chain is detectable.
|
|
73
|
+
*/
|
|
74
|
+
digest: string;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 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.
|
|
78
|
+
*/
|
|
79
|
+
export interface Ext {
|
|
80
|
+
[k: string]: unknown | undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Trust Task type URI. */
|
|
84
|
+
export const TYPE_URI = "https://trusttasks.org/spec/chat/message/1.0" as const;
|
|
85
|
+
|
|
86
|
+
/** Trust Task response type URI (request type URI + "#response"). */
|
|
87
|
+
export const RESPONSE_TYPE_URI = "https://trusttasks.org/spec/chat/message/1.0#response" as const;
|
package/src/index.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * as AuthStepUpApproveResponse_v0_2 from "./auth/step-up/approve-response
|
|
|
31
31
|
export * as AuthStepUpPolicy_v0_1 from "./auth/step-up/policy/0.1/payload";
|
|
32
32
|
export * as AuthStepUpPolicy_v0_2 from "./auth/step-up/policy/0.2/payload";
|
|
33
33
|
export * as AuthWhoami_v0_1 from "./auth/whoami/0.1/payload";
|
|
34
|
+
export * as ChatMessage_v1_0 from "./chat/message/1.0/payload";
|
|
34
35
|
export * as ConfirmRequest_v0_1 from "./confirm/request/0.1/payload";
|
|
35
36
|
export * as ConfirmResponse_v0_1 from "./confirm/response/0.1/payload";
|
|
36
37
|
export * as DeviceBindingShared_v0_1 from "./device/_shared/0.1/device-binding";
|