@segmentstream/ontology 0.156.1 → 0.158.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 +40 -0
- package/README.md +8 -7
- package/dist/agent-chat.d.ts +1 -1
- package/dist/agent-chat.js +8 -8
- package/dist/agent-draft.d.ts +287 -0
- package/dist/{agent-review.js → agent-draft.js} +103 -82
- package/dist/analyze.d.ts +1 -1
- package/dist/analyze.js +71 -14
- package/dist/channel-files.d.ts +70 -0
- package/dist/channel-files.js +58 -0
- package/dist/chat.d.ts +2 -2
- package/dist/earlier-entity-names.d.ts +35 -0
- package/dist/earlier-entity-names.js +88 -0
- package/dist/email.d.ts +2 -0
- package/dist/email.js +1 -0
- package/dist/gmail-send.d.ts +39 -0
- package/dist/gmail-send.js +179 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/migrate/plan.js +31 -2
- package/dist/permissions.d.ts +5 -5
- package/dist/permissions.js +13 -10
- package/dist/replicated-entities.d.ts +1 -1
- package/dist/replicated-entities.js +4 -1
- package/dist/replication/bigquery.d.ts +24 -2
- package/dist/replication/bigquery.js +72 -12
- package/dist/runtime/agents.d.ts +1 -1
- package/dist/runtime/agents.js +43 -38
- package/dist/runtime/service-binding.js +1 -1
- package/dist/service/agent/protocol.d.ts +4 -4
- package/dist/service/agent/protocol.js +7 -7
- package/dist/service/agent/server.js +14 -9
- package/dist/service/chat/envelope.d.ts +12 -12
- package/dist/service/chat/review-delivery.js +23 -22
- package/dist/service/chat/review-revision.d.ts +1 -1
- package/dist/service/chat/review-revision.js +13 -13
- package/dist/service/mcp/runtime-policy.js +1 -1
- package/dist/service/mcp/server.js +9 -1
- package/dist/service/mcp/tools.js +1 -1
- package/dist/service/operations.js +11 -5
- package/dist/service/runtime-contract.d.ts +3 -3
- package/dist/service/service.d.ts +6 -0
- package/dist/service/service.js +21 -3
- package/dist/slack-files.d.ts +53 -0
- package/dist/slack-files.js +183 -0
- package/dist/slack.d.ts +3 -0
- package/dist/slack.js +2 -0
- package/dist/telegram-files.d.ts +81 -0
- package/dist/telegram-files.js +244 -0
- package/dist/telegram.d.ts +3 -1
- package/dist/telegram.js +2 -0
- package/dist/whatsapp-files.d.ts +54 -0
- package/dist/whatsapp-files.js +138 -0
- package/dist/whatsapp.d.ts +3 -0
- package/dist/whatsapp.js +2 -0
- package/dist/workspace-channel.d.ts +20 -0
- package/dist/workspace-channel.js +10 -0
- package/package.json +1 -1
- package/dist/agent-review.d.ts +0 -154
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { ChannelAnswerError, isRecord, jsonCall, replyJson, unrelayed, } from "./channel-files.js";
|
|
2
|
+
/** The most bytes WhatsApp fetches of a file of each type. */
|
|
3
|
+
export const WHATSAPP_FILE_BYTES = {
|
|
4
|
+
image: 5 * 1024 * 1024,
|
|
5
|
+
audio: 16 * 1024 * 1024,
|
|
6
|
+
video: 16 * 1024 * 1024,
|
|
7
|
+
document: 100 * 1024 * 1024,
|
|
8
|
+
};
|
|
9
|
+
/** The most characters a WhatsApp caption has. */
|
|
10
|
+
export const WHATSAPP_CAPTION_LIMIT = 1024;
|
|
11
|
+
/** A WhatsApp message id. */
|
|
12
|
+
const WAMID = /^wamid\.[A-Za-z0-9+/=_-]{1,512}$/u;
|
|
13
|
+
/** How WhatsApp sends a file of this content type. */
|
|
14
|
+
export function whatsappFileType(contentType) {
|
|
15
|
+
const type = contentType.toLowerCase().split(";")[0]?.trim() ?? "";
|
|
16
|
+
if (type === "image/jpeg" || type === "image/png") {
|
|
17
|
+
return "image";
|
|
18
|
+
}
|
|
19
|
+
if (type === "video/mp4" || type === "video/3gpp") {
|
|
20
|
+
return "video";
|
|
21
|
+
}
|
|
22
|
+
if (type.startsWith("audio/")) {
|
|
23
|
+
return "audio";
|
|
24
|
+
}
|
|
25
|
+
return "document";
|
|
26
|
+
}
|
|
27
|
+
/** Why WhatsApp cannot take this file, or undefined when it can. */
|
|
28
|
+
export function whatsappFileRefusal(file) {
|
|
29
|
+
const type = whatsappFileType(file.contentType);
|
|
30
|
+
if (file.size > WHATSAPP_FILE_BYTES[type]) {
|
|
31
|
+
return {
|
|
32
|
+
code: "too_large",
|
|
33
|
+
message: `WhatsApp's ${type} limit is ${WHATSAPP_FILE_BYTES[type]} bytes.`,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (file.size === 0) {
|
|
37
|
+
return { code: "empty", message: "WhatsApp cannot send an empty file." };
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Sends one message per file to `recipient`, `{ to }` by phone number or `{ recipient }` by
|
|
43
|
+
* business-scoped user id, `caption` with the first; `replyTo` answers a message with the first.
|
|
44
|
+
* A caption sent on its own is never put on a file, whatever became of it.
|
|
45
|
+
* Each message is a part: `sent` when Meta names it, `failed` when Meta refused it with an error
|
|
46
|
+
* code, otherwise `uncertain`. Nothing is retried, and a failed message does not stop the next.
|
|
47
|
+
*/
|
|
48
|
+
export async function sendWhatsAppFiles(options) {
|
|
49
|
+
const parts = [];
|
|
50
|
+
let replyTo = options.replyTo;
|
|
51
|
+
let caption = options.caption === "" ? undefined : options.caption;
|
|
52
|
+
const first = options.files[0];
|
|
53
|
+
async function send(part, type, message) {
|
|
54
|
+
let reply;
|
|
55
|
+
try {
|
|
56
|
+
reply = await options.request(jsonCall("graph", "/phone/messages", {
|
|
57
|
+
messaging_product: "whatsapp",
|
|
58
|
+
recipient_type: "individual",
|
|
59
|
+
...options.recipient,
|
|
60
|
+
...(replyTo === undefined ? {} : { context: { message_id: replyTo } }),
|
|
61
|
+
type,
|
|
62
|
+
[type]: message,
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return { ...unrelayed(part, error, options.definite), type };
|
|
67
|
+
}
|
|
68
|
+
replyTo = undefined;
|
|
69
|
+
const answer = replyJson(reply);
|
|
70
|
+
const id = isRecord(answer)
|
|
71
|
+
? isRecord(Array.isArray(answer.messages) ? answer.messages[0] : undefined)
|
|
72
|
+
? answer.messages[0].id
|
|
73
|
+
: undefined
|
|
74
|
+
: undefined;
|
|
75
|
+
if (reply.status >= 200 && reply.status < 300 && typeof id === "string" && WAMID.test(id)) {
|
|
76
|
+
return { ...part, type, status: "sent", messageIds: [id] };
|
|
77
|
+
}
|
|
78
|
+
const error = isRecord(answer) && isRecord(answer.error) ? answer.error : undefined;
|
|
79
|
+
return {
|
|
80
|
+
...part,
|
|
81
|
+
type,
|
|
82
|
+
status: reply.status >= 400 && reply.status < 500 && Number.isInteger(error?.code)
|
|
83
|
+
? "failed"
|
|
84
|
+
: "uncertain",
|
|
85
|
+
messageIds: [],
|
|
86
|
+
code: reply.status === 413
|
|
87
|
+
? "too_large"
|
|
88
|
+
: reply.status === 401 || reply.status === 403
|
|
89
|
+
? "forbidden"
|
|
90
|
+
: reply.status >= 200 && reply.status < 300
|
|
91
|
+
? "invalid_response"
|
|
92
|
+
: "send_failed",
|
|
93
|
+
cause: new ChannelAnswerError(`WhatsApp answered with status ${reply.status}` +
|
|
94
|
+
(Number.isInteger(error?.code) ? ` and code ${String(error.code)}.` : "."), reply.status, reply),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (caption !== undefined &&
|
|
98
|
+
(caption.length > WHATSAPP_CAPTION_LIMIT ||
|
|
99
|
+
(first !== undefined && whatsappFileType(first.contentType) === "audio"))) {
|
|
100
|
+
const sent = await send({ files: [], text: true }, "text", {
|
|
101
|
+
body: caption,
|
|
102
|
+
preview_url: false,
|
|
103
|
+
});
|
|
104
|
+
parts.push(sent);
|
|
105
|
+
// The files never carry a caption that needed its own message, whether or not it went.
|
|
106
|
+
caption = undefined;
|
|
107
|
+
}
|
|
108
|
+
for (const [position, file] of options.files.entries()) {
|
|
109
|
+
const type = whatsappFileType(file.contentType);
|
|
110
|
+
const captioned = caption !== undefined && type !== "audio";
|
|
111
|
+
let link;
|
|
112
|
+
try {
|
|
113
|
+
link = typeof file.link === "string" ? file.link : await file.link();
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
parts.push({
|
|
117
|
+
files: [file.index ?? position],
|
|
118
|
+
text: false,
|
|
119
|
+
type,
|
|
120
|
+
status: "failed",
|
|
121
|
+
messageIds: [],
|
|
122
|
+
code: "unavailable",
|
|
123
|
+
cause: error,
|
|
124
|
+
});
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const sent = await send({ files: [file.index ?? position], text: captioned }, type, {
|
|
128
|
+
link,
|
|
129
|
+
...(captioned ? { caption } : {}),
|
|
130
|
+
...(type === "document" ? { filename: file.filename } : {}),
|
|
131
|
+
});
|
|
132
|
+
parts.push(sent);
|
|
133
|
+
if (sent.status === "sent" && captioned) {
|
|
134
|
+
caption = undefined;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return parts;
|
|
138
|
+
}
|
package/dist/whatsapp.d.ts
CHANGED
|
@@ -18,3 +18,6 @@ export declare function renderWhatsApp(text: string, attribution: string, separa
|
|
|
18
18
|
* status's refusal in the message's `failure` with the same code the ontology keeps a send's with.
|
|
19
19
|
*/
|
|
20
20
|
export { REFUSALS as WHATSAPP_REFUSALS } from "./service/chat/providers/whatsapp-refusals.js";
|
|
21
|
+
export type { ChannelCall, ChannelPart, ChannelReply, ChannelRequest, DefiniteFailure, } from "./channel-files.js";
|
|
22
|
+
export { ChannelAnswerError } from "./channel-files.js";
|
|
23
|
+
export { sendWhatsAppFiles, whatsappFileRefusal, whatsappFileType, WHATSAPP_CAPTION_LIMIT, WHATSAPP_FILE_BYTES, type WhatsAppFileType, type WhatsAppLinkedFile, type WhatsAppSentPart, } from "./whatsapp-files.js";
|
package/dist/whatsapp.js
CHANGED
|
@@ -35,3 +35,5 @@ export function renderWhatsApp(text, attribution, separator = "\n\n") {
|
|
|
35
35
|
* status's refusal in the message's `failure` with the same code the ontology keeps a send's with.
|
|
36
36
|
*/
|
|
37
37
|
export { REFUSALS as WHATSAPP_REFUSALS } from "./service/chat/providers/whatsapp-refusals.js";
|
|
38
|
+
export { ChannelAnswerError } from "./channel-files.js";
|
|
39
|
+
export { sendWhatsAppFiles, whatsappFileRefusal, whatsappFileType, WHATSAPP_CAPTION_LIMIT, WHATSAPP_FILE_BYTES, } from "./whatsapp-files.js";
|
|
@@ -44,7 +44,27 @@ export interface WorkspaceChannelSend {
|
|
|
44
44
|
/** The message the post answers, when the channel replies to one. */
|
|
45
45
|
readonly reply_to: string | null;
|
|
46
46
|
readonly text: string;
|
|
47
|
+
/**
|
|
48
|
+
* Files the message carries after its text, in order, which a channel whose code takes files
|
|
49
|
+
* (`limits.files`) sends with it; one that takes none answers `422 { error: "files_unsupported" }`
|
|
50
|
+
* and sends nothing. At most {@link WORKSPACE_CHANNEL_FILES_BYTES} bytes together.
|
|
51
|
+
*/
|
|
52
|
+
readonly files?: ReadonlyArray<WorkspaceChannelFile>;
|
|
53
|
+
}
|
|
54
|
+
/** One file of {@link WorkspaceChannelSend}, its bytes in base64. */
|
|
55
|
+
export interface WorkspaceChannelFile {
|
|
56
|
+
readonly filename: string;
|
|
57
|
+
readonly content_type: string;
|
|
58
|
+
readonly data: string;
|
|
47
59
|
}
|
|
60
|
+
/** The most bytes of files one message through a workspace channel carries, before encoding. */
|
|
61
|
+
export declare const WORKSPACE_CHANNEL_FILES_BYTES: number;
|
|
62
|
+
/** The files of a {@link WorkspaceChannelSend}, as the send route takes them. */
|
|
63
|
+
export declare function workspaceChannelFiles(files: ReadonlyArray<{
|
|
64
|
+
readonly filename: string;
|
|
65
|
+
readonly contentType: string;
|
|
66
|
+
readonly bytes: Uint8Array;
|
|
67
|
+
}>): ReadonlyArray<WorkspaceChannelFile>;
|
|
48
68
|
/**
|
|
49
69
|
* The agent's answer: `200 { message_id }` once the channel's `send` returned, with the provider's
|
|
50
70
|
* id when it gave one. A `4xx` with `{ error }` sent nothing; anything else may have sent it.
|
|
@@ -34,3 +34,13 @@ export const WORKSPACE_CHANNEL_TEXT_LIMIT = 20_000;
|
|
|
34
34
|
export function renderWorkspaceChannelText(text, attribution, separator) {
|
|
35
35
|
return attribution === "" ? text : `${text}${separator}${attribution}`;
|
|
36
36
|
}
|
|
37
|
+
/** The most bytes of files one message through a workspace channel carries, before encoding. */
|
|
38
|
+
export const WORKSPACE_CHANNEL_FILES_BYTES = 3 * 1024 * 1024;
|
|
39
|
+
/** The files of a {@link WorkspaceChannelSend}, as the send route takes them. */
|
|
40
|
+
export function workspaceChannelFiles(files) {
|
|
41
|
+
return files.map((file) => ({
|
|
42
|
+
filename: file.filename,
|
|
43
|
+
content_type: file.contentType,
|
|
44
|
+
data: Buffer.from(file.bytes).toString("base64"),
|
|
45
|
+
}));
|
|
46
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segmentstream/ontology",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.158.0",
|
|
4
4
|
"description": "Define a SegmentStream workspace app's ontology: entities, relationships, roles and actions, written with Effect.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "SegmentStream",
|
package/dist/agent-review.d.ts
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
/**
|
|
3
|
-
* A reply the workspace's agent held for review. `agent/segmentstream.json` says, per role of the
|
|
4
|
-
* person the agent replies to, whether a member reviews its replies (`chats.*.review`);
|
|
5
|
-
* the agent records each reply it holds here, and only the actions below change it. Approving sends
|
|
6
|
-
* the reply, or the member's edit of it, to the person's chat as the agent, without the
|
|
7
|
-
* sender attribution a chat post carries, at most once; rejecting discards it. Reading, approving
|
|
8
|
-
* and rejecting each need a permission that names `agent_review`: an entity wildcard does not cover
|
|
9
|
-
* it, since its records hold the workspace's chats with the people it serves.
|
|
10
|
-
*/
|
|
11
|
-
export declare const AGENT_REVIEW_STATUSES: readonly [{
|
|
12
|
-
readonly value: "pending";
|
|
13
|
-
readonly description: "Waiting for a member to approve, edit or reject it.";
|
|
14
|
-
}, {
|
|
15
|
-
readonly value: "sent";
|
|
16
|
-
readonly description: "Approved and delivered to the person.";
|
|
17
|
-
}, {
|
|
18
|
-
readonly value: "uncertain";
|
|
19
|
-
readonly description: "Approved; the provider may have delivered it, and it is never sent again.";
|
|
20
|
-
}, {
|
|
21
|
-
readonly value: "failed";
|
|
22
|
-
readonly description: "Approved; the provider refused it, and nothing was sent.";
|
|
23
|
-
}, {
|
|
24
|
-
readonly value: "rejected";
|
|
25
|
-
readonly description: "Rejected: the person never sees it.";
|
|
26
|
-
}, {
|
|
27
|
-
readonly value: "superseded";
|
|
28
|
-
readonly description: "Redrafted at a member's request: the review that revises it replaces it.";
|
|
29
|
-
}];
|
|
30
|
-
export declare const AGENT_REVIEW_REVISION_STATES: readonly [{
|
|
31
|
-
readonly value: "requested";
|
|
32
|
-
readonly description: "A member asked the agent to redraft it; it is redrafting.";
|
|
33
|
-
}, {
|
|
34
|
-
readonly value: "failed";
|
|
35
|
-
readonly description: "The agent could not redraft it; it still waits as it is.";
|
|
36
|
-
}];
|
|
37
|
-
export declare const AGENT_REVIEW_MODES: readonly [{
|
|
38
|
-
readonly value: "always";
|
|
39
|
-
readonly description: "Every reply in the chat waits for a member.";
|
|
40
|
-
}, {
|
|
41
|
-
readonly value: "whenUnsure";
|
|
42
|
-
readonly description: "The decision model was not sure enough that staff would send it as written.";
|
|
43
|
-
}];
|
|
44
|
-
/** The longest reply a review holds; a provider may accept less in one message. */
|
|
45
|
-
export declare const AGENT_REVIEW_TEXT_LIMIT = 20000;
|
|
46
|
-
/** The longest reason a member gives for rejecting a reply. */
|
|
47
|
-
export declare const AGENT_REVIEW_REASON_LIMIT = 2000;
|
|
48
|
-
/** The longest note a member gives the agent for redrafting a reply. */
|
|
49
|
-
export declare const AGENT_REVIEW_NOTE_LIMIT = 2000;
|
|
50
|
-
/** The most members a review names as the readers of its reply, as many as a reply to mail goes to. */
|
|
51
|
-
export declare const AGENT_REVIEW_PARTICIPANTS_LIMIT = 50;
|
|
52
|
-
/** Addresses as a review keeps them in `to` and `cc`: separated by commas. */
|
|
53
|
-
export declare function reviewAddresses(addresses: ReadonlyArray<string>): string;
|
|
54
|
-
/** The addresses a review keeps in `to` or `cc`; none for an empty value. */
|
|
55
|
-
export declare function addressesOfReview(value: unknown): ReadonlyArray<string>;
|
|
56
|
-
/** Members as a review keeps them in `participants`: their user ids, once each, by commas. */
|
|
57
|
-
export declare function reviewParticipants(ids: ReadonlyArray<string>): string;
|
|
58
|
-
/** The members a review keeps in `participants`, once each; anything that is no user id is left out. */
|
|
59
|
-
export declare function participantsOfReview(value: unknown): ReadonlyArray<string>;
|
|
60
|
-
export declare const AgentReview: import("./entity.js").Entity<"agent_review", {
|
|
61
|
-
readonly key: import("./property.js").Property<string, false, true>;
|
|
62
|
-
readonly provider: import("./property.js").Property<string, false, false>;
|
|
63
|
-
readonly channel: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
64
|
-
readonly chatId: import("./property.js").Property<string, false, false>;
|
|
65
|
-
readonly recipient: import("./property.js").Property<string, false, false>;
|
|
66
|
-
readonly to: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
67
|
-
readonly cc: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
68
|
-
readonly participants: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
69
|
-
readonly chatKind: import("./property.js").Property<"private" | "group", false, false>;
|
|
70
|
-
readonly threadId: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
71
|
-
readonly replyTo: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
72
|
-
readonly sessionId: import("./property.js").Property<string, false, false>;
|
|
73
|
-
readonly draft: import("./property.js").Property<string, false, false>;
|
|
74
|
-
readonly text: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
75
|
-
readonly status: import("./property.js").Property<"pending" | "sent" | "uncertain" | "failed" | "rejected" | "superseded", false, false>;
|
|
76
|
-
readonly mode: import("./property.js").Property<"always" | "whenUnsure", false, false>;
|
|
77
|
-
readonly confidence: Schema.optionalKey<import("./property.js").Property<number, false, false>>;
|
|
78
|
-
readonly messageId: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
79
|
-
readonly decidedAt: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
80
|
-
readonly reason: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
81
|
-
readonly note: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
82
|
-
readonly revision: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
83
|
-
readonly revisionState: Schema.optionalKey<import("./property.js").Property<"failed" | "requested", false, false>>;
|
|
84
|
-
}, {
|
|
85
|
-
readonly person: import("./relationship.js").OneRelationship<false, false, "user">;
|
|
86
|
-
readonly decidedBy: import("./relationship.js").OneRelationship<true, false, "user">;
|
|
87
|
-
readonly notedBy: import("./relationship.js").OneRelationship<true, false, "user">;
|
|
88
|
-
readonly revises: import("./relationship.js").OneRelationship<true, false, "agent_review">;
|
|
89
|
-
readonly agentChat: import("./relationship.js").OneRelationship<true, false, "agent_chat">;
|
|
90
|
-
}, import("./entity.js").InvocableActions<{
|
|
91
|
-
readonly approve: import("./action.js").Action<Schema.Struct<{
|
|
92
|
-
readonly review: Schema.Codec<string, string, never, never>;
|
|
93
|
-
readonly text: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
94
|
-
readonly to: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
95
|
-
readonly cc: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
96
|
-
}>, {
|
|
97
|
-
to?: readonly string[] | undefined;
|
|
98
|
-
cc?: readonly string[] | undefined;
|
|
99
|
-
review: string;
|
|
100
|
-
status: "sent" | "uncertain" | "failed";
|
|
101
|
-
message_id: string | null;
|
|
102
|
-
duplicate: boolean;
|
|
103
|
-
}>;
|
|
104
|
-
readonly reject: import("./action.js").Action<Schema.Struct<{
|
|
105
|
-
readonly review: Schema.Codec<string, string, never, never>;
|
|
106
|
-
readonly reason: Schema.optionalKey<import("./property.js").Property<string, false, false>>;
|
|
107
|
-
}>, {
|
|
108
|
-
review: string;
|
|
109
|
-
status: "rejected";
|
|
110
|
-
}>;
|
|
111
|
-
readonly revise: import("./action.js").Action<Schema.Struct<{
|
|
112
|
-
readonly review: Schema.Codec<string, string, never, never>;
|
|
113
|
-
readonly note: import("./property.js").Property<string, false, false>;
|
|
114
|
-
}>, {
|
|
115
|
-
review: string;
|
|
116
|
-
revision: string;
|
|
117
|
-
status: "requested";
|
|
118
|
-
}>;
|
|
119
|
-
}, "agent_review", {
|
|
120
|
-
readonly id: string;
|
|
121
|
-
readonly createdAt: string;
|
|
122
|
-
readonly updatedAt: string;
|
|
123
|
-
readonly createdBy: string | null;
|
|
124
|
-
readonly updatedBy: string | null;
|
|
125
|
-
readonly key: string;
|
|
126
|
-
readonly provider: string;
|
|
127
|
-
readonly channel: string | null;
|
|
128
|
-
readonly chatId: string;
|
|
129
|
-
readonly recipient: string;
|
|
130
|
-
readonly to: string | null;
|
|
131
|
-
readonly cc: string | null;
|
|
132
|
-
readonly participants: string | null;
|
|
133
|
-
readonly chatKind: "private" | "group";
|
|
134
|
-
readonly threadId: string | null;
|
|
135
|
-
readonly replyTo: string | null;
|
|
136
|
-
readonly sessionId: string;
|
|
137
|
-
readonly draft: string;
|
|
138
|
-
readonly text: string | null;
|
|
139
|
-
readonly status: "pending" | "sent" | "uncertain" | "failed" | "rejected" | "superseded";
|
|
140
|
-
readonly mode: "always" | "whenUnsure";
|
|
141
|
-
readonly confidence: number | null;
|
|
142
|
-
readonly messageId: string | null;
|
|
143
|
-
readonly decidedAt: string | null;
|
|
144
|
-
readonly reason: string | null;
|
|
145
|
-
readonly note: string | null;
|
|
146
|
-
readonly revision: string | null;
|
|
147
|
-
readonly revisionState: "failed" | "requested" | null;
|
|
148
|
-
readonly personId: string;
|
|
149
|
-
readonly decidedById: string | null;
|
|
150
|
-
readonly notedById: string | null;
|
|
151
|
-
readonly revisesId: string | null;
|
|
152
|
-
readonly agentChatId: string | null;
|
|
153
|
-
}>, Readonly<Record<never, never>>, "actions">;
|
|
154
|
-
export type AgentReview = typeof AgentReview.Type;
|