@segmentstream/ontology 0.137.1 → 0.139.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/CHANGELOG.md +24 -0
- package/dist/agent-chat.d.ts +13 -0
- package/dist/agent-chat.js +2 -1
- package/dist/analyze.d.ts +2 -0
- package/dist/analyze.js +14 -5
- package/dist/chat.d.ts +43 -0
- package/dist/chat.js +30 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/manifest.d.ts +40 -21
- package/dist/manifest.js +14 -5
- package/dist/migrate/model.d.ts +14 -6
- package/dist/service/chat/attribution.d.ts +1 -0
- package/dist/service/chat/delivery.js +47 -12
- package/dist/service/chat/idempotency.d.ts +13 -0
- package/dist/service/chat/idempotency.js +23 -1
- package/dist/service/chat/providers/provider.d.ts +7 -2
- package/dist/service/chat/providers/slack.d.ts +4 -3
- package/dist/service/chat/providers/slack.js +8 -5
- package/dist/service/chat/providers/whatsapp-template.d.ts +36 -3
- package/dist/service/chat/providers/whatsapp-template.js +205 -54
- package/dist/service/schemas.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.139.0
|
|
4
|
+
|
|
5
|
+
The inbox takes `attribution`: `inbox: { roles: [client], attribution: "none" }` sends a member's
|
|
6
|
+
own reply to a person in the inbox, from their session in the app, as written, without the
|
|
7
|
+
separator or their name, and archives that text alone. The reply stays the member's own message,
|
|
8
|
+
and its `requestedBy` still names them, with an empty `attribution`. The default, `"name"`, signs
|
|
9
|
+
the reply with `chat.attribution` as before, and writes nothing new into the manifest. Posts to
|
|
10
|
+
group chats, and posts by OAuth clients, services and the agent's sessions, stay signed whatever
|
|
11
|
+
the inbox says. `check` reports `invalid-inbox` for any other value.
|
|
12
|
+
|
|
13
|
+
An approved Slack reply goes in the thread it answers: `agent_review.approve` posts it with the
|
|
14
|
+
review's `threadId` as Slack's `thread_ts`, in a channel or in the person's direct message, and
|
|
15
|
+
records it `sent` only when Slack confirms that thread. Chat posts are unchanged.
|
|
16
|
+
|
|
17
|
+
## 0.138.0
|
|
18
|
+
|
|
19
|
+
`agent_chat.send` sends WhatsApp templates with a header and buttons: `header.parameters` for a text
|
|
20
|
+
header's variables, `header.media` for an image, video or document header's file, by an https `url`
|
|
21
|
+
or as a `file` stored in the ontology that the caller may read, and `buttons` for a link button's
|
|
22
|
+
variable, a copy-code button's code or a quick-reply button's payload, by the button's position.
|
|
23
|
+
Everything is checked against the approved template before anything is reserved, and the key binds
|
|
24
|
+
every value given. The archive keeps the buttons as the person reads them, and the delivery's
|
|
25
|
+
payload names a stored file by its reference, never by its link.
|
|
26
|
+
|
|
3
27
|
## 0.137.1
|
|
4
28
|
|
|
5
29
|
The agent's built-in instructions and the descriptions builders' agents read use neutral examples
|
package/dist/agent-chat.d.ts
CHANGED
|
@@ -64,6 +64,19 @@ export declare const AgentChat: import("./entity.js").Entity<"agent_chat", {
|
|
|
64
64
|
readonly name: Schema.String;
|
|
65
65
|
readonly language: Schema.String;
|
|
66
66
|
readonly parameters: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
67
|
+
readonly header: Schema.optionalKey<Schema.Struct<{
|
|
68
|
+
readonly parameters: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
69
|
+
readonly media: Schema.optionalKey<Schema.Struct<{
|
|
70
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
71
|
+
readonly file: Schema.optionalKey<Schema.Struct<{
|
|
72
|
+
readonly entity: Schema.String;
|
|
73
|
+
readonly id: Schema.String;
|
|
74
|
+
readonly property: Schema.optionalKey<Schema.String>;
|
|
75
|
+
}>>;
|
|
76
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
77
|
+
}>>;
|
|
78
|
+
}>>;
|
|
79
|
+
readonly buttons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
67
80
|
}>>;
|
|
68
81
|
readonly replyTo: Schema.optionalKey<Schema.String>;
|
|
69
82
|
readonly idempotencyKey: Schema.String;
|
package/dist/agent-chat.js
CHANGED
|
@@ -211,7 +211,8 @@ export const AgentChat = entity("agent_chat", {
|
|
|
211
211
|
"message the provider refuses spends its key and says why in refusal: outside_reply_window " +
|
|
212
212
|
"(on WhatsApp the person last wrote more than 24 hours ago), recipient_unreachable or " +
|
|
213
213
|
"recipient_opted_out. On WhatsApp, template sends an approved template in place of text, " +
|
|
214
|
-
"which reaches a person outside the 24 hours
|
|
214
|
+
"which reaches a person outside the 24 hours, with its body's, header's and buttons' " +
|
|
215
|
+
"values; give exactly one of text and template.",
|
|
215
216
|
input: ChatSendInput,
|
|
216
217
|
hints: { destructive: false, irreversible: true, idempotent: true },
|
|
217
218
|
connections: [],
|
package/dist/analyze.d.ts
CHANGED
|
@@ -237,6 +237,8 @@ export interface Analysis {
|
|
|
237
237
|
readonly takeover: {
|
|
238
238
|
readonly channels: ReadonlyArray<string>;
|
|
239
239
|
};
|
|
240
|
+
/** Whether a member's own reply to the person carries their name. */
|
|
241
|
+
readonly attribution: "name" | "none";
|
|
240
242
|
};
|
|
241
243
|
readonly entities: ReadonlyArray<ResolvedEntity>;
|
|
242
244
|
/** The workspace-owned `member` role and declared roles, then the implicit reporter when enabled. */
|
package/dist/analyze.js
CHANGED
|
@@ -355,8 +355,9 @@ export function analyze(config, options = {}) {
|
|
|
355
355
|
}
|
|
356
356
|
/**
|
|
357
357
|
* `inbox`: the wire names of the roles whose private chats join the inbox, each a declared role or
|
|
358
|
-
* `member`,
|
|
359
|
-
* every channel `chat` declares
|
|
358
|
+
* `member`, the channels whose chats staff may take over: those `takeover.channels` lists, or
|
|
359
|
+
* every channel `chat` declares, and whether a member's own reply carries their name: `name`
|
|
360
|
+
* unless `attribution` is `none`; `undefined` when absent or malformed.
|
|
360
361
|
*/
|
|
361
362
|
function inboxOptions(value, declaredRoles,
|
|
362
363
|
/** Whether the ontology declares `guest`, whose visitors' chats the inbox may take. */
|
|
@@ -367,13 +368,19 @@ chatChannels, report) {
|
|
|
367
368
|
return undefined;
|
|
368
369
|
}
|
|
369
370
|
if (!isPlainObject(value) ||
|
|
370
|
-
Object.keys(value).some((key) => key !== "roles" && key !== "takeover") ||
|
|
371
|
+
Object.keys(value).some((key) => key !== "roles" && key !== "takeover" && key !== "attribution") ||
|
|
371
372
|
!Array.isArray(value.roles) ||
|
|
372
373
|
value.roles.length === 0) {
|
|
373
|
-
report("invalid-inbox", "inbox",
|
|
374
|
+
report("invalid-inbox", "inbox", 'inbox takes { roles: [...], takeover?: { channels?: [...] }, attribution?: "name" | ' +
|
|
375
|
+
'"none" }, at least one role.');
|
|
374
376
|
return undefined;
|
|
375
377
|
}
|
|
376
378
|
const takeover = takeoverOptions(value.takeover, chatChannels, report);
|
|
379
|
+
const attribution = value.attribution === undefined ? "name" : value.attribution;
|
|
380
|
+
if (attribution !== "name" && attribution !== "none") {
|
|
381
|
+
report("invalid-inbox", "inbox.attribution", 'inbox.attribution takes "name", the default, which signs a member\'s reply with their ' +
|
|
382
|
+
'name, or "none".');
|
|
383
|
+
}
|
|
377
384
|
const declared = new Set(declaredRoles.map((candidate) => candidate.name));
|
|
378
385
|
if (guests) {
|
|
379
386
|
declared.add(GUEST_ROLE);
|
|
@@ -394,7 +401,9 @@ chatChannels, report) {
|
|
|
394
401
|
roles.push(name);
|
|
395
402
|
}
|
|
396
403
|
});
|
|
397
|
-
return valid && takeover !== undefined
|
|
404
|
+
return valid && takeover !== undefined && (attribution === "name" || attribution === "none")
|
|
405
|
+
? { roles, takeover, attribution }
|
|
406
|
+
: undefined;
|
|
398
407
|
}
|
|
399
408
|
/**
|
|
400
409
|
* `inbox.takeover`: the channels whose private chats staff may take over from the agent, each a
|
package/dist/chat.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export interface InboxOptions<R = unknown> {
|
|
|
18
18
|
readonly takeover?: {
|
|
19
19
|
readonly channels?: ReadonlyArray<string>;
|
|
20
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Whether a member's own reply to the person, from their session in the app, carries their name
|
|
23
|
+
* as `chat.attribution` lays it out: `"name"`, the default, or `"none"`, sent and archived as
|
|
24
|
+
* written and still the member's message. Every other post stays signed.
|
|
25
|
+
*/
|
|
26
|
+
readonly attribution?: "name" | "none";
|
|
21
27
|
}
|
|
22
28
|
import { Context, Effect, Schema } from "effect";
|
|
23
29
|
import type { ActionError } from "./errors.js";
|
|
@@ -28,11 +34,35 @@ export declare const ChatPostInput: Schema.Struct<{
|
|
|
28
34
|
readonly idempotencyKey: Schema.String;
|
|
29
35
|
}>;
|
|
30
36
|
export type ChatPostInput = typeof ChatPostInput.Type;
|
|
37
|
+
/** The file of a template's image, video or document header, where it is stored or served. */
|
|
38
|
+
export declare const ChatTemplateMedia: Schema.Struct<{
|
|
39
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
40
|
+
readonly file: Schema.optionalKey<Schema.Struct<{
|
|
41
|
+
readonly entity: Schema.String;
|
|
42
|
+
readonly id: Schema.String;
|
|
43
|
+
readonly property: Schema.optionalKey<Schema.String>;
|
|
44
|
+
}>>;
|
|
45
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
46
|
+
}>;
|
|
47
|
+
export type ChatTemplateMedia = typeof ChatTemplateMedia.Type;
|
|
31
48
|
/** A WhatsApp template message: an approved template by name and language, with its values. */
|
|
32
49
|
export declare const ChatTemplate: Schema.Struct<{
|
|
33
50
|
readonly name: Schema.String;
|
|
34
51
|
readonly language: Schema.String;
|
|
35
52
|
readonly parameters: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
53
|
+
readonly header: Schema.optionalKey<Schema.Struct<{
|
|
54
|
+
readonly parameters: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
55
|
+
readonly media: Schema.optionalKey<Schema.Struct<{
|
|
56
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
57
|
+
readonly file: Schema.optionalKey<Schema.Struct<{
|
|
58
|
+
readonly entity: Schema.String;
|
|
59
|
+
readonly id: Schema.String;
|
|
60
|
+
readonly property: Schema.optionalKey<Schema.String>;
|
|
61
|
+
}>>;
|
|
62
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
63
|
+
}>>;
|
|
64
|
+
}>>;
|
|
65
|
+
readonly buttons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
36
66
|
}>;
|
|
37
67
|
export type ChatTemplate = typeof ChatTemplate.Type;
|
|
38
68
|
/** What `agent_chat.send` takes: a post's text, or on WhatsApp an approved template instead. */
|
|
@@ -43,6 +73,19 @@ export declare const ChatSendInput: Schema.Struct<{
|
|
|
43
73
|
readonly name: Schema.String;
|
|
44
74
|
readonly language: Schema.String;
|
|
45
75
|
readonly parameters: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
76
|
+
readonly header: Schema.optionalKey<Schema.Struct<{
|
|
77
|
+
readonly parameters: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
78
|
+
readonly media: Schema.optionalKey<Schema.Struct<{
|
|
79
|
+
readonly url: Schema.optionalKey<Schema.String>;
|
|
80
|
+
readonly file: Schema.optionalKey<Schema.Struct<{
|
|
81
|
+
readonly entity: Schema.String;
|
|
82
|
+
readonly id: Schema.String;
|
|
83
|
+
readonly property: Schema.optionalKey<Schema.String>;
|
|
84
|
+
}>>;
|
|
85
|
+
readonly filename: Schema.optionalKey<Schema.String>;
|
|
86
|
+
}>>;
|
|
87
|
+
}>>;
|
|
88
|
+
readonly buttons: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
46
89
|
}>>;
|
|
47
90
|
readonly replyTo: Schema.optionalKey<Schema.String>;
|
|
48
91
|
readonly idempotencyKey: Schema.String;
|
package/dist/chat.js
CHANGED
|
@@ -9,6 +9,23 @@ export const ChatPostInput = Schema.Struct({
|
|
|
9
9
|
replyTo: Schema.optionalKey(Identifier),
|
|
10
10
|
idempotencyKey: Identifier,
|
|
11
11
|
});
|
|
12
|
+
/** The file of a template's image, video or document header, where it is stored or served. */
|
|
13
|
+
export const ChatTemplateMedia = Schema.Struct({
|
|
14
|
+
url: Schema.optionalKey(Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(2000)).annotate({
|
|
15
|
+
description: "An https link WhatsApp fetches the file from.",
|
|
16
|
+
})),
|
|
17
|
+
file: Schema.optionalKey(Schema.Struct({
|
|
18
|
+
entity: Identifier,
|
|
19
|
+
id: Identifier,
|
|
20
|
+
property: Schema.optionalKey(Identifier),
|
|
21
|
+
}).annotate({
|
|
22
|
+
description: "A file stored in the ontology, which the caller may read: the record and its file " +
|
|
23
|
+
"property, content by default.",
|
|
24
|
+
})),
|
|
25
|
+
filename: Schema.optionalKey(Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(240)).annotate({
|
|
26
|
+
description: "A document's file name, as the person sees it.",
|
|
27
|
+
})),
|
|
28
|
+
});
|
|
12
29
|
/** A WhatsApp template message: an approved template by name and language, with its values. */
|
|
13
30
|
export const ChatTemplate = Schema.Struct({
|
|
14
31
|
name: Identifier.annotate({ description: "The approved template's name in WhatsApp Manager." }),
|
|
@@ -19,6 +36,19 @@ export const ChatTemplate = Schema.Struct({
|
|
|
19
36
|
description: 'The values of the template body\'s variables: "1", "2", … for numbered variables, the ' +
|
|
20
37
|
"variables' names for named ones.",
|
|
21
38
|
})),
|
|
39
|
+
header: Schema.optionalKey(Schema.Struct({
|
|
40
|
+
parameters: Schema.optionalKey(Schema.Record(Schema.String, Schema.String).annotate({
|
|
41
|
+
description: "A text header's variables' values, given as the body's are.",
|
|
42
|
+
})),
|
|
43
|
+
media: Schema.optionalKey(ChatTemplateMedia.annotate({
|
|
44
|
+
description: "An image, video or document header's file: by url or by file, not both.",
|
|
45
|
+
})),
|
|
46
|
+
}).annotate({ description: "The values of the template's header, when it takes any." })),
|
|
47
|
+
buttons: Schema.optionalKey(Schema.Record(Schema.String, Schema.String).annotate({
|
|
48
|
+
description: 'The values of the template\'s buttons by their position, "0" for the first: a link ' +
|
|
49
|
+
"button's variable, a copy-code button's code, or the payload a quick-reply button " +
|
|
50
|
+
"returns when tapped.",
|
|
51
|
+
})),
|
|
22
52
|
});
|
|
23
53
|
/** What `agent_chat.send` takes: a post's text, or on WhatsApp an approved template instead. */
|
|
24
54
|
export const ChatSendInput = Schema.Struct({
|
package/dist/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export { AgentReview, AGENT_REVIEW_MODES, AGENT_REVIEW_STATUSES, AGENT_REVIEW_TE
|
|
|
63
63
|
export { ATTACHABLE_IDENTITY_PROVIDERS, UserIdentity, USER_IDENTITY_ORIGINS, } from "./user-identity.js";
|
|
64
64
|
export type { AttachableIdentityProvider, UserIdentityOrigin } from "./user-identity.js";
|
|
65
65
|
export { AppFeedback, AppFeedbackFile, APP_FEEDBACK_ENTITIES, APP_FEEDBACK_FILE_MAX_BYTES, } from "./app-feedback.js";
|
|
66
|
-
export { ChatDelivery, ChatHistoryImportInput, ChatHistoryImportResult, ChatHistoryMessage, ChatPostInput, ChatSendInput, ChatTemplate, ChatPostResult, } from "./chat.js";
|
|
66
|
+
export { ChatDelivery, ChatHistoryImportInput, ChatHistoryImportResult, ChatHistoryMessage, ChatPostInput, ChatSendInput, ChatTemplate, ChatTemplateMedia, ChatPostResult, } from "./chat.js";
|
|
67
67
|
export { CHAT_CHANNEL_KINDS, CHAT_CHANNEL_NAME, CHAT_KINDS, WORKSPACE_CHANNEL_KIND, channelIdentityProvider, } from "./chat-channel.js";
|
|
68
68
|
export type { ChatChannelKind, ChatKind } from "./chat-channel.js";
|
|
69
69
|
export type { InboxOptions, ReviewReviseInput, ReviewReviseResult, ReviewSendInput, ReviewSendResult, } from "./chat.js";
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,7 @@ export { AgentChat } from "./agent-chat.js";
|
|
|
37
37
|
export { AgentReview, AGENT_REVIEW_MODES, AGENT_REVIEW_STATUSES, AGENT_REVIEW_TEXT_LIMIT, } from "./agent-review.js";
|
|
38
38
|
export { ATTACHABLE_IDENTITY_PROVIDERS, UserIdentity, USER_IDENTITY_ORIGINS, } from "./user-identity.js";
|
|
39
39
|
export { AppFeedback, AppFeedbackFile, APP_FEEDBACK_ENTITIES, APP_FEEDBACK_FILE_MAX_BYTES, } from "./app-feedback.js";
|
|
40
|
-
export { ChatDelivery, ChatHistoryImportInput, ChatHistoryImportResult, ChatHistoryMessage, ChatPostInput, ChatSendInput, ChatTemplate, ChatPostResult, } from "./chat.js";
|
|
40
|
+
export { ChatDelivery, ChatHistoryImportInput, ChatHistoryImportResult, ChatHistoryMessage, ChatPostInput, ChatSendInput, ChatTemplate, ChatTemplateMedia, ChatPostResult, } from "./chat.js";
|
|
41
41
|
export { CHAT_CHANNEL_KINDS, CHAT_CHANNEL_NAME, CHAT_KINDS, WORKSPACE_CHANNEL_KIND, channelIdentityProvider, } from "./chat-channel.js";
|
|
42
42
|
// The query language of `find` and of the service's list, query and traversal routes.
|
|
43
43
|
export { DEFAULT_QUERY_LIMIT, entityQueryResultSchema, entityQuerySchema, entityQuerySchemas, entityRecordSchema, FILTER_OPERATORS, LIST_FILTER_OPERATORS, MANY_QUANTIFIERS, MAX_IN_VALUES, MAX_QUERY_LIMIT, OrderBy, Query, queryFields, queryJsonSchema, queryLinks, QueryResult, queryResultJsonSchema, queryResultSchema, SortDirection, WHERE_COMBINATORS, } from "./query.js";
|
package/dist/manifest.d.ts
CHANGED
|
@@ -92,7 +92,9 @@ import { type ResolvedGuest, type ResolvedSignInOptions, type SignInPolicy } fro
|
|
|
92
92
|
* Within version 15, the top-level `inbox`, written only when declared, holds the wire names of the
|
|
93
93
|
* `roles` whose people's private chats the agent registers as `agent_chat` records of kind
|
|
94
94
|
* `private`, and in `takeover.channels` the channels whose chats staff may take over from the
|
|
95
|
-
* agent. Older readers ignore it, register none and let none be taken over.
|
|
95
|
+
* agent. Older readers ignore it, register none and let none be taken over. `inbox` may carry
|
|
96
|
+
* `attribution: "none"`, written only when declared: a member's own reply in the inbox is sent and
|
|
97
|
+
* archived without their name. Older readers ignore it and sign the reply.
|
|
96
98
|
* Within version 15, a webhook trigger's `signature` may have scheme `hmac` and carry the provider's
|
|
97
99
|
* format, written only when declared. Older readers present the scheme and ignore the format; an
|
|
98
100
|
* older publication check refuses the scheme. A signature may carry `generated: true` instead of
|
|
@@ -1306,16 +1308,18 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
|
|
|
1306
1308
|
}>>;
|
|
1307
1309
|
}>>;
|
|
1308
1310
|
/**
|
|
1309
|
-
* Whose private chats join the inbox, within version 15: the wire names of their roles,
|
|
1310
|
-
* channels whose chats staff may take over from the agent
|
|
1311
|
-
*
|
|
1312
|
-
*
|
|
1311
|
+
* Whose private chats join the inbox, within version 15: the wire names of their roles, the
|
|
1312
|
+
* channels whose chats staff may take over from the agent, and `attribution: "none"` when a
|
|
1313
|
+
* member's own reply there goes without their name. Written only when declared; absent
|
|
1314
|
+
* registers no private chat, absent `takeover` lets no chat be taken over, absent `attribution`
|
|
1315
|
+
* signs replies, and older readers ignore all three.
|
|
1313
1316
|
*/
|
|
1314
1317
|
readonly inbox: Schema.optionalKey<Schema.Struct<{
|
|
1315
1318
|
readonly roles: Schema.$Array<Schema.String>;
|
|
1316
1319
|
readonly takeover: Schema.optionalKey<Schema.Struct<{
|
|
1317
1320
|
readonly channels: Schema.$Array<Schema.String>;
|
|
1318
1321
|
}>>;
|
|
1322
|
+
readonly attribution: Schema.optionalKey<Schema.Literals<readonly ["name", "none"]>>;
|
|
1319
1323
|
}>>;
|
|
1320
1324
|
/**
|
|
1321
1325
|
* The metrics of the model, since version 8. Written only when there are some; absent reads as
|
|
@@ -1661,10 +1665,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
1661
1665
|
readonly prefix?: string | undefined;
|
|
1662
1666
|
} | undefined;
|
|
1663
1667
|
readonly timestamp?: {
|
|
1668
|
+
readonly header?: string | undefined;
|
|
1664
1669
|
readonly unit?: string | undefined;
|
|
1665
1670
|
readonly entry?: string | undefined;
|
|
1666
1671
|
readonly tolerance?: number | undefined;
|
|
1667
|
-
readonly header?: string | undefined;
|
|
1668
1672
|
} | undefined;
|
|
1669
1673
|
readonly input?: string | undefined;
|
|
1670
1674
|
readonly generated?: true | undefined;
|
|
@@ -1796,6 +1800,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
1796
1800
|
} | undefined;
|
|
1797
1801
|
readonly inbox?: {
|
|
1798
1802
|
readonly roles: readonly string[];
|
|
1803
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
1799
1804
|
readonly takeover?: {
|
|
1800
1805
|
readonly channels: readonly string[];
|
|
1801
1806
|
} | undefined;
|
|
@@ -2014,10 +2019,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
2014
2019
|
readonly prefix?: string | undefined;
|
|
2015
2020
|
} | undefined;
|
|
2016
2021
|
readonly timestamp?: {
|
|
2022
|
+
readonly header?: string | undefined;
|
|
2017
2023
|
readonly unit?: string | undefined;
|
|
2018
2024
|
readonly entry?: string | undefined;
|
|
2019
2025
|
readonly tolerance?: number | undefined;
|
|
2020
|
-
readonly header?: string | undefined;
|
|
2021
2026
|
} | undefined;
|
|
2022
2027
|
readonly input?: string | undefined;
|
|
2023
2028
|
readonly generated?: true | undefined;
|
|
@@ -2149,6 +2154,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
2149
2154
|
} | undefined;
|
|
2150
2155
|
readonly inbox?: {
|
|
2151
2156
|
readonly roles: readonly string[];
|
|
2157
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
2152
2158
|
readonly takeover?: {
|
|
2153
2159
|
readonly channels: readonly string[];
|
|
2154
2160
|
} | undefined;
|
|
@@ -2369,10 +2375,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
2369
2375
|
readonly prefix?: string | undefined;
|
|
2370
2376
|
} | undefined;
|
|
2371
2377
|
readonly timestamp?: {
|
|
2378
|
+
readonly header?: string | undefined;
|
|
2372
2379
|
readonly unit?: string | undefined;
|
|
2373
2380
|
readonly entry?: string | undefined;
|
|
2374
2381
|
readonly tolerance?: number | undefined;
|
|
2375
|
-
readonly header?: string | undefined;
|
|
2376
2382
|
} | undefined;
|
|
2377
2383
|
readonly input?: string | undefined;
|
|
2378
2384
|
readonly generated?: true | undefined;
|
|
@@ -2465,6 +2471,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
2465
2471
|
} | undefined;
|
|
2466
2472
|
readonly inbox?: {
|
|
2467
2473
|
readonly roles: readonly string[];
|
|
2474
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
2468
2475
|
readonly takeover?: {
|
|
2469
2476
|
readonly channels: readonly string[];
|
|
2470
2477
|
} | undefined;
|
|
@@ -2722,10 +2729,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
2722
2729
|
readonly prefix?: string | undefined;
|
|
2723
2730
|
} | undefined;
|
|
2724
2731
|
readonly timestamp?: {
|
|
2732
|
+
readonly header?: string | undefined;
|
|
2725
2733
|
readonly unit?: string | undefined;
|
|
2726
2734
|
readonly entry?: string | undefined;
|
|
2727
2735
|
readonly tolerance?: number | undefined;
|
|
2728
|
-
readonly header?: string | undefined;
|
|
2729
2736
|
} | undefined;
|
|
2730
2737
|
readonly input?: string | undefined;
|
|
2731
2738
|
readonly generated?: true | undefined;
|
|
@@ -2855,6 +2862,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
2855
2862
|
} | undefined;
|
|
2856
2863
|
readonly inbox?: {
|
|
2857
2864
|
readonly roles: readonly string[];
|
|
2865
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
2858
2866
|
readonly takeover?: {
|
|
2859
2867
|
readonly channels: readonly string[];
|
|
2860
2868
|
} | undefined;
|
|
@@ -3207,16 +3215,18 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
3207
3215
|
}>>;
|
|
3208
3216
|
}>>;
|
|
3209
3217
|
/**
|
|
3210
|
-
* Whose private chats join the inbox, within version 15: the wire names of their roles,
|
|
3211
|
-
* channels whose chats staff may take over from the agent
|
|
3212
|
-
*
|
|
3213
|
-
*
|
|
3218
|
+
* Whose private chats join the inbox, within version 15: the wire names of their roles, the
|
|
3219
|
+
* channels whose chats staff may take over from the agent, and `attribution: "none"` when a
|
|
3220
|
+
* member's own reply there goes without their name. Written only when declared; absent
|
|
3221
|
+
* registers no private chat, absent `takeover` lets no chat be taken over, absent `attribution`
|
|
3222
|
+
* signs replies, and older readers ignore all three.
|
|
3214
3223
|
*/
|
|
3215
3224
|
readonly inbox: Schema.optionalKey<Schema.Struct<{
|
|
3216
3225
|
readonly roles: Schema.$Array<Schema.String>;
|
|
3217
3226
|
readonly takeover: Schema.optionalKey<Schema.Struct<{
|
|
3218
3227
|
readonly channels: Schema.$Array<Schema.String>;
|
|
3219
3228
|
}>>;
|
|
3229
|
+
readonly attribution: Schema.optionalKey<Schema.Literals<readonly ["name", "none"]>>;
|
|
3220
3230
|
}>>;
|
|
3221
3231
|
/**
|
|
3222
3232
|
* The metrics of the model, since version 8. Written only when there are some; absent reads as
|
|
@@ -3683,16 +3693,18 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
3683
3693
|
}>>;
|
|
3684
3694
|
}>>;
|
|
3685
3695
|
/**
|
|
3686
|
-
* Whose private chats join the inbox, within version 15: the wire names of their roles,
|
|
3687
|
-
* channels whose chats staff may take over from the agent
|
|
3688
|
-
*
|
|
3689
|
-
*
|
|
3696
|
+
* Whose private chats join the inbox, within version 15: the wire names of their roles, the
|
|
3697
|
+
* channels whose chats staff may take over from the agent, and `attribution: "none"` when a
|
|
3698
|
+
* member's own reply there goes without their name. Written only when declared; absent
|
|
3699
|
+
* registers no private chat, absent `takeover` lets no chat be taken over, absent `attribution`
|
|
3700
|
+
* signs replies, and older readers ignore all three.
|
|
3690
3701
|
*/
|
|
3691
3702
|
readonly inbox: Schema.optionalKey<Schema.Struct<{
|
|
3692
3703
|
readonly roles: Schema.$Array<Schema.String>;
|
|
3693
3704
|
readonly takeover: Schema.optionalKey<Schema.Struct<{
|
|
3694
3705
|
readonly channels: Schema.$Array<Schema.String>;
|
|
3695
3706
|
}>>;
|
|
3707
|
+
readonly attribution: Schema.optionalKey<Schema.Literals<readonly ["name", "none"]>>;
|
|
3696
3708
|
}>>;
|
|
3697
3709
|
/**
|
|
3698
3710
|
* The metrics of the model, since version 8. Written only when there are some; absent reads as
|
|
@@ -4030,10 +4042,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
4030
4042
|
readonly prefix?: string | undefined;
|
|
4031
4043
|
} | undefined;
|
|
4032
4044
|
readonly timestamp?: {
|
|
4045
|
+
readonly header?: string | undefined;
|
|
4033
4046
|
readonly unit?: string | undefined;
|
|
4034
4047
|
readonly entry?: string | undefined;
|
|
4035
4048
|
readonly tolerance?: number | undefined;
|
|
4036
|
-
readonly header?: string | undefined;
|
|
4037
4049
|
} | undefined;
|
|
4038
4050
|
readonly input?: string | undefined;
|
|
4039
4051
|
readonly generated?: true | undefined;
|
|
@@ -4165,6 +4177,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
4165
4177
|
} | undefined;
|
|
4166
4178
|
readonly inbox?: {
|
|
4167
4179
|
readonly roles: readonly string[];
|
|
4180
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
4168
4181
|
readonly takeover?: {
|
|
4169
4182
|
readonly channels: readonly string[];
|
|
4170
4183
|
} | undefined;
|
|
@@ -4383,10 +4396,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
4383
4396
|
readonly prefix?: string | undefined;
|
|
4384
4397
|
} | undefined;
|
|
4385
4398
|
readonly timestamp?: {
|
|
4399
|
+
readonly header?: string | undefined;
|
|
4386
4400
|
readonly unit?: string | undefined;
|
|
4387
4401
|
readonly entry?: string | undefined;
|
|
4388
4402
|
readonly tolerance?: number | undefined;
|
|
4389
|
-
readonly header?: string | undefined;
|
|
4390
4403
|
} | undefined;
|
|
4391
4404
|
readonly input?: string | undefined;
|
|
4392
4405
|
readonly generated?: true | undefined;
|
|
@@ -4518,6 +4531,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
|
|
|
4518
4531
|
} | undefined;
|
|
4519
4532
|
readonly inbox?: {
|
|
4520
4533
|
readonly roles: readonly string[];
|
|
4534
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
4521
4535
|
readonly takeover?: {
|
|
4522
4536
|
readonly channels: readonly string[];
|
|
4523
4537
|
} | undefined;
|
|
@@ -4742,10 +4756,10 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
|
|
|
4742
4756
|
readonly prefix?: string | undefined;
|
|
4743
4757
|
} | undefined;
|
|
4744
4758
|
readonly timestamp?: {
|
|
4759
|
+
readonly header?: string | undefined;
|
|
4745
4760
|
readonly unit?: string | undefined;
|
|
4746
4761
|
readonly entry?: string | undefined;
|
|
4747
4762
|
readonly tolerance?: number | undefined;
|
|
4748
|
-
readonly header?: string | undefined;
|
|
4749
4763
|
} | undefined;
|
|
4750
4764
|
readonly input?: string | undefined;
|
|
4751
4765
|
readonly generated?: true | undefined;
|
|
@@ -4877,6 +4891,7 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
|
|
|
4877
4891
|
} | undefined;
|
|
4878
4892
|
readonly inbox?: {
|
|
4879
4893
|
readonly roles: readonly string[];
|
|
4894
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
4880
4895
|
readonly takeover?: {
|
|
4881
4896
|
readonly channels: readonly string[];
|
|
4882
4897
|
} | undefined;
|
|
@@ -5095,10 +5110,10 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
|
|
|
5095
5110
|
readonly prefix?: string | undefined;
|
|
5096
5111
|
} | undefined;
|
|
5097
5112
|
readonly timestamp?: {
|
|
5113
|
+
readonly header?: string | undefined;
|
|
5098
5114
|
readonly unit?: string | undefined;
|
|
5099
5115
|
readonly entry?: string | undefined;
|
|
5100
5116
|
readonly tolerance?: number | undefined;
|
|
5101
|
-
readonly header?: string | undefined;
|
|
5102
5117
|
} | undefined;
|
|
5103
5118
|
readonly input?: string | undefined;
|
|
5104
5119
|
readonly generated?: true | undefined;
|
|
@@ -5230,6 +5245,7 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
|
|
|
5230
5245
|
} | undefined;
|
|
5231
5246
|
readonly inbox?: {
|
|
5232
5247
|
readonly roles: readonly string[];
|
|
5248
|
+
readonly attribution?: "name" | "none" | undefined;
|
|
5233
5249
|
readonly takeover?: {
|
|
5234
5250
|
readonly channels: readonly string[];
|
|
5235
5251
|
} | undefined;
|
|
@@ -5286,6 +5302,8 @@ export declare function signUpRolesOf(manifest: Pick<OntologyManifest, "signIn">
|
|
|
5286
5302
|
export declare function inboxRolesOf(manifest: Pick<OntologyManifest, "inbox">): ReadonlySet<string>;
|
|
5287
5303
|
/** The channels whose private chats staff may take over from the agent; empty without any. */
|
|
5288
5304
|
export declare function takeoverChannelsOf(manifest: Pick<OntologyManifest, "inbox">): ReadonlySet<string>;
|
|
5305
|
+
/** Whether a member's own reply in the inbox carries their name: `name` unless declared `none`. */
|
|
5306
|
+
export declare function inboxAttributionOf(manifest: Pick<OntologyManifest, "inbox">): "name" | "none";
|
|
5289
5307
|
/**
|
|
5290
5308
|
* The account providers people write from on the channels staff take chats over on: a platform
|
|
5291
5309
|
* channel's kind, whose accounts every channel of the kind shares, and `channel:<name>` for a
|
|
@@ -5349,6 +5367,7 @@ export declare function buildManifest(input: {
|
|
|
5349
5367
|
readonly takeover: {
|
|
5350
5368
|
readonly channels: ReadonlyArray<string>;
|
|
5351
5369
|
};
|
|
5370
|
+
readonly attribution?: "name" | "none";
|
|
5352
5371
|
};
|
|
5353
5372
|
readonly entities: ReadonlyArray<ResolvedEntity>;
|
|
5354
5373
|
readonly roles: ReadonlyArray<Role>;
|
package/dist/manifest.js
CHANGED
|
@@ -93,7 +93,9 @@ import { CHANNEL_PROVIDERS, DEFAULT_SIGN_IN_POLICY, isGuestBotCheckScheme, isGue
|
|
|
93
93
|
* Within version 15, the top-level `inbox`, written only when declared, holds the wire names of the
|
|
94
94
|
* `roles` whose people's private chats the agent registers as `agent_chat` records of kind
|
|
95
95
|
* `private`, and in `takeover.channels` the channels whose chats staff may take over from the
|
|
96
|
-
* agent. Older readers ignore it, register none and let none be taken over.
|
|
96
|
+
* agent. Older readers ignore it, register none and let none be taken over. `inbox` may carry
|
|
97
|
+
* `attribution: "none"`, written only when declared: a member's own reply in the inbox is sent and
|
|
98
|
+
* archived without their name. Older readers ignore it and sign the reply.
|
|
97
99
|
* Within version 15, a webhook trigger's `signature` may have scheme `hmac` and carry the provider's
|
|
98
100
|
* format, written only when declared. Older readers present the scheme and ignore the format; an
|
|
99
101
|
* older publication check refuses the scheme. A signature may carry `generated: true` instead of
|
|
@@ -610,14 +612,16 @@ const OntologyManifestModel = Schema.Struct({
|
|
|
610
612
|
})),
|
|
611
613
|
})),
|
|
612
614
|
/**
|
|
613
|
-
* Whose private chats join the inbox, within version 15: the wire names of their roles,
|
|
614
|
-
* channels whose chats staff may take over from the agent
|
|
615
|
-
*
|
|
616
|
-
*
|
|
615
|
+
* Whose private chats join the inbox, within version 15: the wire names of their roles, the
|
|
616
|
+
* channels whose chats staff may take over from the agent, and `attribution: "none"` when a
|
|
617
|
+
* member's own reply there goes without their name. Written only when declared; absent
|
|
618
|
+
* registers no private chat, absent `takeover` lets no chat be taken over, absent `attribution`
|
|
619
|
+
* signs replies, and older readers ignore all three.
|
|
617
620
|
*/
|
|
618
621
|
inbox: Schema.optionalKey(Schema.Struct({
|
|
619
622
|
roles: Schema.Array(Schema.String),
|
|
620
623
|
takeover: Schema.optionalKey(Schema.Struct({ channels: Schema.Array(Schema.String) })),
|
|
624
|
+
attribution: Schema.optionalKey(Schema.Literals(["name", "none"])),
|
|
621
625
|
})),
|
|
622
626
|
/**
|
|
623
627
|
* The metrics of the model, since version 8. Written only when there are some; absent reads as
|
|
@@ -721,6 +725,10 @@ export function inboxRolesOf(manifest) {
|
|
|
721
725
|
export function takeoverChannelsOf(manifest) {
|
|
722
726
|
return new Set(manifest.inbox?.takeover?.channels ?? []);
|
|
723
727
|
}
|
|
728
|
+
/** Whether a member's own reply in the inbox carries their name: `name` unless declared `none`. */
|
|
729
|
+
export function inboxAttributionOf(manifest) {
|
|
730
|
+
return manifest.inbox?.attribution === "none" ? "none" : "name";
|
|
731
|
+
}
|
|
724
732
|
/**
|
|
725
733
|
* The account providers people write from on the channels staff take chats over on: a platform
|
|
726
734
|
* channel's kind, whose accounts every channel of the kind shares, and `channel:<name>` for a
|
|
@@ -1098,6 +1106,7 @@ export function buildManifest(input) {
|
|
|
1098
1106
|
inbox: {
|
|
1099
1107
|
roles: [...input.inbox.roles],
|
|
1100
1108
|
takeover: { channels: [...input.inbox.takeover.channels] },
|
|
1109
|
+
...(input.inbox.attribution === "none" ? { attribution: "none" } : {}),
|
|
1101
1110
|
},
|
|
1102
1111
|
}),
|
|
1103
1112
|
...(connections.length > 0
|