@segmentstream/agent 0.78.0 → 0.80.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 +18 -0
- package/README.md +1 -1
- package/dist/_chunks/{build-metadata-WG90Pemy.mjs → build-metadata-DF7IV-oL.mjs} +1 -1
- package/dist/_chunks/{chat-archive-CdumQXGM.mjs → chat-archive-BBd_iZ1d.mjs} +2 -2
- package/dist/_chunks/{chat-archive-CUMEaSqy.mjs → chat-archive-DavfKJDI.mjs} +20 -2
- package/dist/_chunks/{principal-C7aAjyt4.mjs → principal-CVV9C_nO.mjs} +8 -1
- package/dist/extension/config.d.ts +15 -0
- package/dist/extension/config.mjs +20 -2
- package/dist/extension/connections/ontology.mjs +1 -1
- package/dist/extension/hooks/authorization.mjs +1 -1
- package/dist/extension/hooks/chat-context.mjs +1 -1
- package/dist/extension/hooks/chat-recorder.mjs +1 -1
- package/dist/extension/instructions/persona.mjs +1 -1
- package/dist/extension/lib/actor.mjs +1 -1
- package/dist/extension/lib/admission.d.ts +7 -0
- package/dist/extension/lib/admission.mjs +8 -6
- package/dist/extension/lib/attachment-tools.mjs +1 -1
- package/dist/extension/lib/attachments-send.mjs +1 -1
- package/dist/extension/lib/attachments.mjs +1 -1
- package/dist/extension/lib/build-metadata.mjs +1 -1
- package/dist/extension/lib/chat-address.d.ts +11 -0
- package/dist/extension/lib/chat-address.mjs +1 -1
- package/dist/extension/lib/chat-archive.d.ts +16 -0
- package/dist/extension/lib/chat-archive.mjs +1 -1
- package/dist/extension/lib/chat-context.d.ts +7 -0
- package/dist/extension/lib/chat-context.mjs +2 -2
- package/dist/extension/lib/chat-messages.d.ts +9 -1
- package/dist/extension/lib/chat-messages.mjs +5 -5
- package/dist/extension/lib/chat-recorder.d.ts +12 -4
- package/dist/extension/lib/chat-recorder.mjs +3 -3
- package/dist/extension/lib/chat-store.d.ts +6 -0
- package/dist/extension/lib/confirmations.mjs +1 -1
- package/dist/extension/lib/email/attachments-send.d.ts +6 -4
- package/dist/extension/lib/email/attachments-send.mjs +2 -1
- package/dist/extension/lib/email/channel.d.ts +31 -5
- package/dist/extension/lib/email/channel.mjs +233 -27
- package/dist/extension/lib/email/gmail.d.ts +12 -5
- package/dist/extension/lib/email/gmail.mjs +12 -0
- package/dist/extension/lib/email/message.d.ts +5 -0
- package/dist/extension/lib/email/message.mjs +10 -5
- package/dist/extension/lib/group-routing/routing-context.mjs +1 -1
- package/dist/extension/lib/guest-usage.mjs +1 -1
- package/dist/extension/lib/identities.d.ts +2 -0
- package/dist/extension/lib/inbound-media/files.mjs +1 -1
- package/dist/extension/lib/inbound-media/index.mjs +1 -1
- package/dist/extension/lib/model-service-alert.mjs +1 -1
- package/dist/extension/lib/ontology-connection.mjs +1 -1
- package/dist/extension/lib/ontology-file-call.mjs +1 -1
- package/dist/extension/lib/ontology-tools.mjs +1 -1
- package/dist/extension/lib/review/client.mjs +68 -31
- package/dist/extension/lib/review/hold.d.ts +18 -0
- package/dist/extension/lib/review/hold.mjs +7 -1
- package/dist/extension/lib/review/judge.mjs +1 -1
- package/dist/extension/lib/review/reply.d.ts +5 -0
- package/dist/extension/lib/review/reply.mjs +2 -2
- package/dist/extension/lib/review/revision-channel.mjs +1 -1
- package/dist/extension/lib/role-skill.mjs +1 -1
- package/dist/extension/lib/runtime-envelope.mjs +1 -1
- package/dist/extension/lib/sent-files.mjs +1 -1
- package/dist/extension/lib/slack/adapter.mjs +2 -2
- package/dist/extension/lib/slack/attachments-send.mjs +1 -1
- package/dist/extension/lib/slack/callbacks.mjs +1 -1
- package/dist/extension/lib/slack/changes.mjs +1 -1
- package/dist/extension/lib/stored-files.mjs +1 -1
- package/dist/extension/lib/telegram/adapter.mjs +4 -4
- package/dist/extension/lib/telegram/attachment-description.mjs +1 -1
- package/dist/extension/lib/telegram/attachments-send.mjs +1 -1
- package/dist/extension/lib/telegram/callbacks.mjs +1 -1
- package/dist/extension/lib/telegram/chat-archive.mjs +1 -1
- package/dist/extension/lib/telegram/confirmations.mjs +2 -2
- package/dist/extension/lib/telegram/customer-text.mjs +1 -1
- package/dist/extension/lib/telegram/delivery-diagnostics.mjs +1 -1
- package/dist/extension/lib/telegram/files.mjs +1 -1
- package/dist/extension/lib/telegram/health.mjs +1 -1
- package/dist/extension/lib/telegram/held-approvals.mjs +1 -1
- package/dist/extension/lib/telegram/inbound-request.mjs +1 -1
- package/dist/extension/lib/telegram/inbound.mjs +2 -2
- package/dist/extension/lib/telegram/lifecycle.mjs +2 -2
- package/dist/extension/lib/telegram/principal.mjs +1 -1
- package/dist/extension/lib/telegram/session-recovery.mjs +1 -1
- package/dist/extension/lib/telegram/silent.mjs +1 -1
- package/dist/extension/lib/telegram/store-capture.mjs +1 -1
- package/dist/extension/lib/telegram/structured.mjs +1 -1
- package/dist/extension/lib/telegram/turn-errors.mjs +2 -2
- package/dist/extension/lib/web/auth.mjs +1 -1
- package/dist/extension/lib/web/channel.mjs +1 -1
- package/dist/extension/lib/whatsapp/adapter.mjs +2 -2
- package/dist/extension/lib/whatsapp/attachments-send.mjs +2 -2
- package/dist/extension/lib/whatsapp/callbacks.mjs +1 -1
- package/dist/extension/lib/whatsapp/changes.mjs +1 -1
- package/dist/extension/lib/whatsapp/files.mjs +1 -1
- package/dist/extension/lib/whatsapp/sent.mjs +1 -1
- package/dist/extension/lib/workspace-action.mjs +1 -1
- package/dist/extension/lib/workspace-channel/attachments-send.mjs +1 -1
- package/dist/extension/lib/workspace-channel/channel.mjs +2 -2
- package/dist/extension/lib/workspace-chat-archive.mjs +1 -1
- package/dist/extension/lib/workspace-source.mjs +1 -1
- package/dist/extension/model.mjs +1 -1
- package/dist/extension/tools/attachments_discard.mjs +1 -1
- package/dist/extension/tools/attachments_list.mjs +1 -1
- package/dist/extension/tools/attachments_promote.mjs +1 -1
- package/dist/extension/tools/attachments_read.mjs +1 -1
- package/dist/extension/tools/attachments_send.mjs +4 -2
- package/dist/extension/tools/attachments_stage.mjs +1 -1
- package/dist/extension/tools/attachments_table.mjs +1 -1
- package/dist/extension/tools/handoff.mjs +1 -1
- package/dist/extension/tools/questions_ask.mjs +1 -1
- package/dist/extension/tools/workspace_source.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.80.0
|
|
4
|
+
|
|
5
|
+
An email thread can be one chat. `"chats": "thread"` on an email channel makes each Gmail thread one chat and one session of the agent, whoever writes in it; `"sender"`, the default, keeps each person's own chat in a thread, as before. Admission stays the sender's: each turn acts as the person who wrote. Each message, and the reply to it, is read by the members it went to, its sender and the members among its `To` and `Cc`, so a person dropped from `Cc` reads none of the thread's later mail. Each admitted person joins the thread's chat in the inbox, which is named after the thread's subject; with `"record": "all"`, any mail the channel records in a thread, even mail the agent does not take from or to members, brings its chat into the inbox where `inbox.channels` lists the channel, and makes no one its member. A reply held for review in a thread's chat is read, once approved, by the same members as a reply the agent sends itself. A new thread chat reads its history from Gmail once, the thread's last 20 messages before it, as imported history. Chats a thread had per person stay, and replies waiting or held there are still sent. A thread's chat replies to all; `"reply": "sender"` is refused with it. Staff answer a thread's chat in Gmail: the inbox's `postMessage` and `send` refuse it. While staff hold a thread's chat, taken over, the agent answers no one in the thread, whatever their role.
|
|
6
|
+
|
|
7
|
+
`POST /api/ontology/agent/chats/seen` takes `shared: true` for a private chat several people share: the member joins its members and none leaves; a member whose roles the inbox does not take joins none, and is answered whether staff hold the chat where it is recorded already. `POST /api/ontology/agent/chats/messages` takes `imported: true` for history a channel read from its provider, never for a send. `POST /api/ontology/agent/reviews` takes `participants`, at most 50 user ids of the members who read a reply in a private chat several people share; `agent_review` keeps them in its new `participants` property, a redraft keeps them, and the approved reply is recorded as read by its `person` and them. An agent on this release whose ontology SDK predates `participants` holds the reply for its person alone.
|
|
8
|
+
|
|
9
|
+
Pins @segmentstream/ontology 0.155.0.
|
|
10
|
+
|
|
11
|
+
## 0.79.0
|
|
12
|
+
|
|
13
|
+
An email channel can reply to all: with `"reply": "all"` in `agent/segmentstream.json`, a reply goes to the person who wrote, in `To`, and copies the other addresses of the `To` and `Cc` of the mail it answers, without the mailbox's own address; files `segmentstream__attachments_send` sends go to the same people. `"sender"`, the default, replies to the person alone, as before. Each state of a reply names whom it goes to in its channel state, so a reply a later wake sends goes to the same people.
|
|
14
|
+
|
|
15
|
+
A held reply to mail keeps whom it goes to: `agent_review` gains `to` and `cc`, and `agent_review.approve` takes `to` and `cc`, lists of plain addresses that replace them, refused on a reply that is not mail. The review records whom it was sent to, and approving again to other people is refused. A reply held before goes to its `recipient` alone. `POST /api/ontology/agent/reviews` takes `to` and `cc` for a reply to mail; an agent on this release whose ontology SDK predates them holds the reply for its person alone. `emailReplyMessage` of `@segmentstream/ontology/email` takes several addresses in `to` and `cc`.
|
|
16
|
+
|
|
17
|
+
In the app, `useInboxChat`'s held replies carry `to` and `cc`, and `approve(reply, text?, { to, cc })` replaces them.
|
|
18
|
+
|
|
19
|
+
Pins @segmentstream/ontology 0.154.0.
|
|
20
|
+
|
|
3
21
|
## 0.78.0
|
|
4
22
|
|
|
5
23
|
Telegram and Slack keep what people change of their messages, and WhatsApp keeps the business's
|
package/README.md
CHANGED
|
@@ -285,7 +285,7 @@ continue using GET lookup. Starter templates and pins remain unchanged in this s
|
|
|
285
285
|
| `segmentstream__telegram` | `channels` | `POST /eve/v1/telegram`: Telegram through the connection, with pairing, routing and voice. |
|
|
286
286
|
| `segmentstream__tasks` | `channels` | `POST /eve/segmentstream/v1/tasks`: a workflow's `agentTask`, run as the workflow's user; see [Workflow tasks](#workflow-tasks). |
|
|
287
287
|
| `segmentstream__revisions` | `channels` | `POST /eve/segmentstream/v1/reviews/revise`: a held reply a member sent back, redrafted in a session of its own that acts as the person, reading only, and reported as a new held reply. |
|
|
288
|
-
| `segmentstream__email` | `channels` | `POST /eve/segmentstream/v1/email`: the `GmailConnection` mailbox in `channels.email`, which SegmentStream wakes;
|
|
288
|
+
| `segmentstream__email` | `channels` | `POST /eve/segmentstream/v1/email`: the `GmailConnection` mailbox in `channels.email`, which SegmentStream wakes; a Gmail thread is a chat per person, or one chat (`chats`). |
|
|
289
289
|
| `segmentstream__attachments_list`, `_read`, `_promote`, `_discard` | `tools` | The member's temporary attachments in this chat: list, read, keep through an action, drop. |
|
|
290
290
|
| `segmentstream__attachments_send` | `tools` | Sends readable stored ontology files into the current Telegram, Slack, WhatsApp or email chat. |
|
|
291
291
|
| `segmentstream__no_reply` | `tools` | Eve's `no_reply`: ends the turn without a message and keeps the model's reason in the session and the archive. |
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
var version = "0.
|
|
7
|
+
var version = "0.80.0";
|
|
8
8
|
function agentBuild(environment = process.env) {
|
|
9
9
|
return {
|
|
10
10
|
agent: version,
|
|
@@ -7,10 +7,10 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { parseArchivedMessage } from "../extension/lib/telegram/archive-message.mjs";
|
|
8
8
|
import { currentChannel, currentKey } from "../extension/lib/channel-scope.mjs";
|
|
9
9
|
import { n as contentText, t as CONTENT_CAPS } from "./content-cDtVnr8Y.mjs";
|
|
10
|
-
import { C as
|
|
10
|
+
import { C as sendFingerprint, S as reasonCode, _ as boundedMeta, a as chatEvent, b as messageInput, f as sessionFailureEventId, p as storeOf, v as cutText, w as storedFiles, x as metaOf } from "./chat-archive-DavfKJDI.mjs";
|
|
11
11
|
import { applyChatChange } from "../extension/lib/chat-messages.mjs";
|
|
12
12
|
import { ChatStoreError } from "../extension/lib/chat-store.mjs";
|
|
13
|
-
import { c as currentInboundRequest, ht as currentThreadId, xt as reportTelegramError } from "./principal-
|
|
13
|
+
import { c as currentInboundRequest, ht as currentThreadId, xt as reportTelegramError } from "./principal-CVV9C_nO.mjs";
|
|
14
14
|
import { telegramReaction } from "../extension/lib/telegram/reactions.mjs";
|
|
15
15
|
import { currentConfirmationPrompt } from "../extension/lib/group-routing/messages.mjs";
|
|
16
16
|
import { messageMetadata } from "../extension/lib/telegram/message-metadata.mjs";
|
|
@@ -366,9 +366,27 @@ function replyEvent(input) {
|
|
|
366
366
|
senderIsBot: true,
|
|
367
367
|
status: input.status,
|
|
368
368
|
messageId: input.messageId ?? null,
|
|
369
|
-
...input.at === void 0 ? {} : { at: input.at }
|
|
369
|
+
...input.at === void 0 ? {} : { at: input.at },
|
|
370
|
+
...input.recipients === void 0 ? {} : { argsSummary: JSON.stringify({ recipients: {
|
|
371
|
+
to: input.recipients.to,
|
|
372
|
+
cc: input.recipients.cc
|
|
373
|
+
} }) }
|
|
370
374
|
});
|
|
371
375
|
}
|
|
376
|
+
function replyRecipients(event) {
|
|
377
|
+
try {
|
|
378
|
+
const value = JSON.parse(event.argsSummary ?? "null");
|
|
379
|
+
const addresses = (list) => Array.isArray(list) && list.every((item) => typeof item === "string") ? list : void 0;
|
|
380
|
+
const to = addresses(value?.recipients?.to);
|
|
381
|
+
const cc = addresses(value?.recipients?.cc ?? []);
|
|
382
|
+
return to === void 0 || cc === void 0 ? void 0 : {
|
|
383
|
+
to,
|
|
384
|
+
cc
|
|
385
|
+
};
|
|
386
|
+
} catch {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
372
390
|
const TOPIC_PAGES = 5;
|
|
373
391
|
const TOPIC_PAGE_SIZE = 100;
|
|
374
392
|
async function topicContext(archive, input) {
|
|
@@ -590,4 +608,4 @@ function summarizeArguments(value) {
|
|
|
590
608
|
};
|
|
591
609
|
return JSON.stringify(workflowValue(visit(value, 0), { boundary: "chat arguments" })).slice(0, 4e3);
|
|
592
610
|
}
|
|
593
|
-
export {
|
|
611
|
+
export { sendFingerprint as C, workspaceChatArchive as E, reasonCode as S, storedMessageId as T, boundedMeta as _, chatEvent as a, messageInput as b, forgetChatStores as c, replyRecipients as d, sessionFailureEventId as f, UNVERIFIED as g, topicContext as h, chatAuthor as i, replyEvent as l, summarizeArguments as m, archiveSequence as n, cloudChatArchive as o, storeOf as p, chatArchive as r, collapseChatEvents as s, AGENT_SENDER as t, replyOperation as u, cutText as v, storedFiles as w, metaOf as x, eventOf as y };
|
|
@@ -39,6 +39,13 @@ const SESSION_HEADER = "X-SegmentStream-Agent-Session";
|
|
|
39
39
|
const CHAT_ATTRIBUTE = "segmentstreamChat";
|
|
40
40
|
const EARLIER_CHAT_ATTRIBUTE = "segmentstreamConversation";
|
|
41
41
|
const RUNTIME_SOURCE_ATTRIBUTE = "segmentstreamRuntimeSource";
|
|
42
|
+
const PARTICIPANTS_ATTRIBUTE = "segmentstreamParticipants";
|
|
43
|
+
function participantsOf(principal) {
|
|
44
|
+
const named = principal?.attributes[PARTICIPANTS_ATTRIBUTE];
|
|
45
|
+
const memberId = principal?.attributes.memberId;
|
|
46
|
+
if (!Array.isArray(named)) return;
|
|
47
|
+
return [...new Set([...typeof memberId === "string" && memberId !== "" ? [memberId] : [], ...named])];
|
|
48
|
+
}
|
|
42
49
|
function chatRuntimeSource(chat, message = {}) {
|
|
43
50
|
if (chat.provider !== "slack" && chat.provider !== "whatsapp") return;
|
|
44
51
|
return {
|
|
@@ -2058,4 +2065,4 @@ function identityProviderOf(principal) {
|
|
|
2058
2065
|
const provider = principal?.attributes.identityProvider;
|
|
2059
2066
|
return typeof provider === "string" && provider !== "" ? provider : void 0;
|
|
2060
2067
|
}
|
|
2061
|
-
export { KIND_ATTRIBUTE as $, ontologyToolLabels as A, CHAT_ATTRIBUTE as At, actorHeaders as B,
|
|
2068
|
+
export { KIND_ATTRIBUTE as $, ontologyToolLabels as A, CHAT_ATTRIBUTE as At, actorHeaders as B, participantsOf as Bt, parseAttachmentUrl as C, withDeliveryLocale as Ct, OntologyFileUnavailable as D, readableRuntimeEnvelope as Dt, OntologyActionNotPermitted as E, principalRuntimeSource as Et, confirmations as F, chatAddressOf as Ft, memberTool as G, actorOf as H, workspaceIdentityProvider as Ht, inputHash as I, chatChannel as It, AGENT_GRANT_HEADER as J, notForGuests as K, needsConfirmation as L, chatHeaders as Lt, promotionTarget as M, PARTICIPANTS_ATTRIBUTE as Mt, CONFIRMATION_TTL_MS as N, RUNTIME_SOURCE_ATTRIBUTE as Nt, OntologyToolRejected as O, runtimeEnvelope as Ot, actionApproval as P, SESSION_HEADER as Pt, INTROSPECTION_PATH as Q, ACT_AS_HEADER as R, chatRuntimeSource as Rt, fetchStoredAttachment as S, safeTelegramFetch as St, ontologyConnection as T, compatibleRuntimeEnvelope as Tt, isGuestSession as U, actorKey as V, withChatAddress as Vt, member as W, GUEST_ID_ATTRIBUTE as X, GUEST_CONFIRMATIONS_ATTRIBUTE as Y, GUEST_ROLE as Z, AttachmentError as _, customerMessage as _t, rolesOf as a, guestConfirms as at, agentAttachments as b, formattingRefused as bt, currentInboundRequest as c, ontologyIntrospection as ct, prepareInboundMedia as d, webMemberOf as dt, TURN_LIMITED_CODE as et, attachmentsContext as f, webPrincipal as ft, ATTACHMENT_URL_PROTOCOL as g, customerCopy as gt, ATTACHMENT_TTL_HOURS as h, currentThreadId as ht, memberIdOf as i, WEB_PROVIDER as it, ontologyTools as j, CHAT_HEADER as jt, actionToolName as k, telegramRuntimeSource as kt, runInboundRequest as l, webAuth as lt, turnContent as m, currentLocale as mt, chatLanguage as n, WEB_AUTHENTICATOR as nt, telegramPrincipal as o, guestIdOf as ot, storeFiles as p, TelegramDeliveryError as pt, ACCESS_TOKEN_PREFIX as q, identityProviderOf as r, WEB_GRANT_ATTRIBUTE as rt, InboundRequest as s, guestPrincipal as st, TELEGRAM_AUTHENTICATOR as t, TurnLimitedError as tt, withReplacedText as u, webGrantOf as ut, EARLIER_CHAT_HEADER as v, customerText as vt, actAsHeaders as w, RUNTIME_SOURCE_PROTOCOL as wt, attachmentUrl as x, reportTelegramError as xt, MAXIMUM_ATTACHMENT_BYTES as y, failureText as yt, ActorRequiredError as z, isSameChat as zt };
|
|
@@ -318,6 +318,17 @@ export interface EmailChannelInput {
|
|
|
318
318
|
readonly record?: "agent" | "all";
|
|
319
319
|
/** With `record: "all"`, which of that mail is recorded, as Gmail's search; all of it when absent. */
|
|
320
320
|
readonly recordQuery?: string;
|
|
321
|
+
/**
|
|
322
|
+
* Whom the agent's replies go to: `sender`, when absent, the person alone; or `all`, the person in
|
|
323
|
+
* `To` and the other people of the mail it answers in `Cc`, as a reply to all.
|
|
324
|
+
*/
|
|
325
|
+
readonly reply?: "all" | "sender";
|
|
326
|
+
/**
|
|
327
|
+
* What a chat is: `sender`, when absent, each person's own chat in a Gmail thread; or `thread`,
|
|
328
|
+
* the thread, one chat and one session for everyone who writes in it, whose replies go to all
|
|
329
|
+
* (`reply` cannot be `sender` with it).
|
|
330
|
+
*/
|
|
331
|
+
readonly chats?: "sender" | "thread";
|
|
321
332
|
}
|
|
322
333
|
/**
|
|
323
334
|
* A channel the workspace defines in its own code, `defineChannel` in `agent/agent/channels/`,
|
|
@@ -628,6 +639,10 @@ export interface EmailSettings {
|
|
|
628
639
|
readonly record?: "agent" | "all";
|
|
629
640
|
/** With `record: "all"`, the Gmail search that narrows what is recorded. */
|
|
630
641
|
readonly recordQuery?: string;
|
|
642
|
+
/** `all` when the agent's replies go to all the people of the mail; absent, to the person alone. */
|
|
643
|
+
readonly reply?: "all";
|
|
644
|
+
/** `thread` when a Gmail thread is one chat; absent, each person has their own in it. */
|
|
645
|
+
readonly chats?: "thread";
|
|
631
646
|
}
|
|
632
647
|
/**
|
|
633
648
|
* A channel the workspace defines in its own code (`defineChannel`): the connection its code calls
|
|
@@ -423,7 +423,9 @@ function emailSettings(value, issues, path = ["channels", "email"]) {
|
|
|
423
423
|
"checkAfterMinutes",
|
|
424
424
|
"push",
|
|
425
425
|
"record",
|
|
426
|
-
"recordQuery"
|
|
426
|
+
"recordQuery",
|
|
427
|
+
"reply",
|
|
428
|
+
"chats"
|
|
427
429
|
],
|
|
428
430
|
issues
|
|
429
431
|
});
|
|
@@ -470,6 +472,20 @@ function emailSettings(value, issues, path = ["channels", "email"]) {
|
|
|
470
472
|
message: "must be a Gmail search of at most 1000 characters",
|
|
471
473
|
path: [...path, "recordQuery"]
|
|
472
474
|
});
|
|
475
|
+
const chats = email.chats ?? "sender";
|
|
476
|
+
const reply = email.reply ?? (chats === "thread" ? "all" : "sender");
|
|
477
|
+
if (reply !== "all" && reply !== "sender") issues.push({
|
|
478
|
+
message: "must be \"all\" or \"sender\"",
|
|
479
|
+
path: [...path, "reply"]
|
|
480
|
+
});
|
|
481
|
+
if (chats !== "sender" && chats !== "thread") issues.push({
|
|
482
|
+
message: "must be \"sender\" or \"thread\"",
|
|
483
|
+
path: [...path, "chats"]
|
|
484
|
+
});
|
|
485
|
+
else if (chats === "thread" && reply === "sender") issues.push({
|
|
486
|
+
message: "needs reply \"all\": a thread's chat is everyone's in it",
|
|
487
|
+
path: [...path, "chats"]
|
|
488
|
+
});
|
|
473
489
|
if (issues.length > before) return null;
|
|
474
490
|
return {
|
|
475
491
|
connection: email.connection,
|
|
@@ -479,7 +495,9 @@ function emailSettings(value, issues, path = ["channels", "email"]) {
|
|
|
479
495
|
...record === "all" ? {
|
|
480
496
|
record: "all",
|
|
481
497
|
...email.recordQuery === void 0 ? {} : { recordQuery: email.recordQuery.trim() }
|
|
482
|
-
} : {}
|
|
498
|
+
} : {},
|
|
499
|
+
...reply === "all" ? { reply: "all" } : {},
|
|
500
|
+
...chats === "thread" ? { chats: "thread" } : {}
|
|
483
501
|
};
|
|
484
502
|
}
|
|
485
503
|
function telegramSettings(value, issues, path = ["channels", "telegram"]) {
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import segmentstream from "../extension.mjs";
|
|
8
|
-
import { T as ontologyConnection } from "../../_chunks/principal-
|
|
8
|
+
import { T as ontologyConnection } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
9
9
|
import { defineDynamic } from "eve/connections";
|
|
10
10
|
var ontology_default = defineDynamic(async (context) => {
|
|
11
11
|
if (!segmentstream.config.ontology.connection) return null;
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import segmentstream from "../extension.mjs";
|
|
8
8
|
import { localizedText } from "../lib/admission.mjs";
|
|
9
9
|
import { confirmationLocale } from "../lib/telegram/confirmation-text.mjs";
|
|
10
|
-
import "../../_chunks/principal-
|
|
10
|
+
import "../../_chunks/principal-CVV9C_nO.mjs";
|
|
11
11
|
import { defineHook } from "eve/hooks";
|
|
12
12
|
var authorization_default = defineHook({ events: { "interaction.opened": (event, context) => {
|
|
13
13
|
const principal = context.session.auth.current;
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import segmentstream from "../extension.mjs";
|
|
8
|
-
import { r as chatArchive } from "../../_chunks/chat-archive-
|
|
8
|
+
import { r as chatArchive } from "../../_chunks/chat-archive-DavfKJDI.mjs";
|
|
9
9
|
import { chatContextHook } from "../lib/chat-context.mjs";
|
|
10
10
|
import { appOrigin } from "../lib/environment.mjs";
|
|
11
11
|
import { agentSessionReviews } from "../lib/review/client.mjs";
|
|
@@ -6,7 +6,7 @@ __eveDirname(__filename);
|
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import segmentstream from "../extension.mjs";
|
|
8
8
|
import { chatRecorder } from "../lib/chat-recorder.mjs";
|
|
9
|
-
import { r as chatArchive } from "../../_chunks/chat-archive-
|
|
9
|
+
import { r as chatArchive } from "../../_chunks/chat-archive-DavfKJDI.mjs";
|
|
10
10
|
import { repliesReviewed } from "../lib/review/hold.mjs";
|
|
11
11
|
import { defineHook } from "eve/hooks";
|
|
12
12
|
var chat_recorder_default = defineHook({ events: { "*": chatRecorder(chatArchive(), (principal) => repliesReviewed(segmentstream.config.review, principal)) } });
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import segmentstream from "../extension.mjs";
|
|
8
|
-
import { a as rolesOf } from "../../_chunks/principal-
|
|
8
|
+
import { a as rolesOf } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
9
9
|
import { personaFor } from "../personas.mjs";
|
|
10
10
|
import { defineDynamic, defineInstructions } from "eve/instructions";
|
|
11
11
|
var persona_default = defineDynamic((context) => {
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { R as ACT_AS_HEADER, z as ActorRequiredError, B as actorHeaders, V as actorKey, H as actorOf, U as isGuestSession, W as member, G as memberTool, K as notForGuests } from "../../_chunks/principal-
|
|
7
|
+
export { R as ACT_AS_HEADER, z as ActorRequiredError, B as actorHeaders, V as actorKey, H as actorOf, U as isGuestSession, W as member, G as memberTool, K as notForGuests } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
@@ -10,6 +10,13 @@ export interface AdmittedChat {
|
|
|
10
10
|
readonly threadId?: string;
|
|
11
11
|
/** Whom a reply is sent to, where it differs from the chat's id. */
|
|
12
12
|
readonly recipient?: string;
|
|
13
|
+
/**
|
|
14
|
+
* A chat several people write in, such as an email thread: each admitted person joins its
|
|
15
|
+
* members, and none leaves. An ontology service released before it refuses the report.
|
|
16
|
+
*/
|
|
17
|
+
readonly shared?: true;
|
|
18
|
+
/** The chat's name, such as an email thread's subject; else the person's name. */
|
|
19
|
+
readonly title?: string;
|
|
13
20
|
}
|
|
14
21
|
/**
|
|
15
22
|
* Reports the private chat of someone the channel recorded without admitting them, such as mail
|
|
@@ -43,14 +43,15 @@ async function reportInboxChat(input) {
|
|
|
43
43
|
return await input.identities.seenChat({
|
|
44
44
|
provider: chat.channel,
|
|
45
45
|
externalId: chat.chatId,
|
|
46
|
-
title: (identity.display?.trim() || identity.externalId).slice(0, 200),
|
|
46
|
+
title: (chat.title?.trim() || identity.display?.trim() || identity.externalId).slice(0, 200),
|
|
47
47
|
...input.memberId === void 0 ? {} : { memberId: input.memberId },
|
|
48
48
|
kind: "private",
|
|
49
49
|
...chat.recipient === void 0 || chat.recipient === chat.chatId ? {} : { recipient: chat.recipient },
|
|
50
|
-
...chat.threadId === void 0 || chat.threadId === "" ? {} : { threadId: chat.threadId }
|
|
50
|
+
...chat.threadId === void 0 || chat.threadId === "" ? {} : { threadId: chat.threadId },
|
|
51
|
+
...chat.shared === true ? { shared: true } : {}
|
|
51
52
|
});
|
|
52
53
|
} catch (error) {
|
|
53
|
-
if (input.memberId === void 0 && error instanceof AgentIdentityError && error.status === 404) return;
|
|
54
|
+
if ((input.memberId === void 0 || chat.shared === true) && error instanceof AgentIdentityError && error.status === 404) return;
|
|
54
55
|
inboxReports.delete(key);
|
|
55
56
|
input.failed?.(error);
|
|
56
57
|
return;
|
|
@@ -88,16 +89,17 @@ async function admitMessage(input) {
|
|
|
88
89
|
} catch (error) {
|
|
89
90
|
input.noticeFailed(error);
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
const shared = input.chat?.shared === true;
|
|
93
|
+
if ((resolved.status === "existing" || resolved.status === "created") && (resolved.inbox === true || shared) && input.identity.chat === "private" && input.chat !== void 0) {
|
|
92
94
|
const reported = await reportInboxChat({
|
|
93
95
|
identity: input.identity,
|
|
94
96
|
identities: input.identities,
|
|
95
97
|
chat: input.chat,
|
|
96
98
|
memberId: resolved.member.id,
|
|
97
|
-
every: resolved.takeover === true,
|
|
99
|
+
every: resolved.takeover === true || shared,
|
|
98
100
|
failed: input.inboxFailed ?? ((error) => console.error("[segmentstream] inbox chat report failed", error))
|
|
99
101
|
});
|
|
100
|
-
if (resolved.takeover === true && reported?.handled === true) return {
|
|
102
|
+
if ((resolved.takeover === true || shared) && reported?.handled === true) return {
|
|
101
103
|
...resolved,
|
|
102
104
|
handled: true
|
|
103
105
|
};
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import { Ft as
|
|
7
|
+
import { Ft as chatAddressOf, It as chatChannel, b as agentAttachments, i as memberIdOf } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
8
8
|
import { detectFile, documentText } from "./attachment-formats.mjs";
|
|
9
9
|
import { readSheets, typedTable } from "./attachment-tables.mjs";
|
|
10
10
|
import { appOrigin } from "./environment.mjs";
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { attachmentOwner } from "./attachment-tools.mjs";
|
|
8
|
-
import {
|
|
8
|
+
import { Ft as chatAddressOf, _ as AttachmentError, yt as failureText } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
9
9
|
import { appOrigin, channelsEnabled } from "./environment.mjs";
|
|
10
10
|
import { transientFileStatus } from "./file-grant.mjs";
|
|
11
11
|
import { runtimeToken } from "./runtime-token.mjs";
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { h as ATTACHMENT_TTL_HOURS, g as ATTACHMENT_URL_PROTOCOL, _ as AttachmentError, jt as CHAT_HEADER, v as EARLIER_CHAT_HEADER, y as MAXIMUM_ATTACHMENT_BYTES,
|
|
7
|
+
export { h as ATTACHMENT_TTL_HOURS, g as ATTACHMENT_URL_PROTOCOL, _ as AttachmentError, jt as CHAT_HEADER, v as EARLIER_CHAT_HEADER, y as MAXIMUM_ATTACHMENT_BYTES, Pt as SESSION_HEADER, b as agentAttachments, x as attachmentUrl, S as fetchStoredAttachment, C as parseAttachmentUrl } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { t as agentBuild } from "../../_chunks/build-metadata-
|
|
7
|
+
export { t as agentBuild } from "../../_chunks/build-metadata-DF7IV-oL.mjs";
|
|
@@ -33,6 +33,17 @@ export declare const SESSION_HEADER = "X-SegmentStream-Agent-Session";
|
|
|
33
33
|
export declare const CHAT_ATTRIBUTE = "segmentstreamChat";
|
|
34
34
|
/** The session attribute that carries, as JSON, the runtime source of the message a turn answers. */
|
|
35
35
|
export declare const RUNTIME_SOURCE_ATTRIBUTE = "segmentstreamRuntimeSource";
|
|
36
|
+
/**
|
|
37
|
+
* The session attribute that names, by user id, the members who read the message a turn answers,
|
|
38
|
+
* and the replies to it, in a private chat several people share, such as an email thread: the
|
|
39
|
+
* chat's readers are named row by row. Absent, a private chat's message is its member's.
|
|
40
|
+
*/
|
|
41
|
+
export declare const PARTICIPANTS_ATTRIBUTE = "segmentstreamParticipants";
|
|
42
|
+
/**
|
|
43
|
+
* The members who read the message `principal`'s turn answers, its own member among them, where
|
|
44
|
+
* the channel names them; undefined for a chat whose messages are its one member's.
|
|
45
|
+
*/
|
|
46
|
+
export declare function participantsOf(principal: SessionAuthContext | null | undefined): ReadonlyArray<string> | undefined;
|
|
36
47
|
/** The message a channel's turn answers, beside its chat: its id and the account that wrote it. */
|
|
37
48
|
export interface ChatMessage {
|
|
38
49
|
readonly id?: string;
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { At as CHAT_ATTRIBUTE, jt as CHAT_HEADER, Mt as
|
|
7
|
+
export { At as CHAT_ATTRIBUTE, jt as CHAT_HEADER, Mt as PARTICIPANTS_ATTRIBUTE, Nt as RUNTIME_SOURCE_ATTRIBUTE, Pt as SESSION_HEADER, Ft as chatAddressOf, It as chatChannel, Lt as chatHeaders, Rt as chatRuntimeSource, zt as isSameChat, Bt as participantsOf, Vt as withChatAddress, Ht as workspaceIdentityProvider } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
@@ -163,7 +163,23 @@ export declare function replyEvent(input: {
|
|
|
163
163
|
readonly status: "requested" | "sent" | "failed";
|
|
164
164
|
readonly messageId?: string;
|
|
165
165
|
readonly at?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Whom a reply to mail goes to, kept in the message's channel state: every state of the reply
|
|
168
|
+
* carries them, so the one still to deliver is sent to the same people.
|
|
169
|
+
*/
|
|
170
|
+
readonly recipients?: {
|
|
171
|
+
readonly to: ReadonlyArray<string>;
|
|
172
|
+
readonly cc: ReadonlyArray<string>;
|
|
173
|
+
};
|
|
166
174
|
}): ChatEvent;
|
|
175
|
+
/**
|
|
176
|
+
* Whom a reply to mail an archived event of {@link replyEvent} goes to, as its channel state keeps
|
|
177
|
+
* them; undefined for a reply that names no one.
|
|
178
|
+
*/
|
|
179
|
+
export declare function replyRecipients(event: Pick<ChatEvent, "argsSummary">): {
|
|
180
|
+
readonly to: ReadonlyArray<string>;
|
|
181
|
+
readonly cc: ReadonlyArray<string>;
|
|
182
|
+
} | undefined;
|
|
167
183
|
/**
|
|
168
184
|
* One chat or forum topic of the archive, newest first. The archive reads every topic when no topic
|
|
169
185
|
* is named, so a message without a topic, such as one in a forum's General topic, collects the rows
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { t as AGENT_SENDER, n as archiveSequence, r as chatArchive, i as chatAuthor, a as chatEvent, o as cloudChatArchive, s as collapseChatEvents, c as forgetChatStores, l as replyEvent, u as replyOperation, d as
|
|
7
|
+
export { t as AGENT_SENDER, n as archiveSequence, r as chatArchive, i as chatAuthor, a as chatEvent, o as cloudChatArchive, s as collapseChatEvents, c as forgetChatStores, l as replyEvent, u as replyOperation, d as replyRecipients, f as sessionFailureEventId, p as storeOf, m as summarizeArguments, h as topicContext } from "../../_chunks/chat-archive-DavfKJDI.mjs";
|
|
@@ -131,6 +131,13 @@ export declare function chatOf(context: {
|
|
|
131
131
|
};
|
|
132
132
|
readonly channel: HookContext["channel"];
|
|
133
133
|
}): {
|
|
134
|
+
provider: string;
|
|
135
|
+
chatId: string;
|
|
136
|
+
chatType: "private";
|
|
137
|
+
threadId: string | null;
|
|
138
|
+
participantIds: readonly string[];
|
|
139
|
+
senderId: string | null;
|
|
140
|
+
} | {
|
|
134
141
|
provider: string;
|
|
135
142
|
chatId: string;
|
|
136
143
|
chatType: "private" | "group" | "channel";
|
|
@@ -6,8 +6,8 @@ __eveDirname(__filename);
|
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { agentTaskIdOf } from "./agent-task.mjs";
|
|
8
8
|
import { chatCoordinates, sessionKind } from "./chat-recorder.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import { xt as reportTelegramError } from "../../_chunks/principal-
|
|
9
|
+
import { h as topicContext, i as chatAuthor, n as archiveSequence, p as storeOf, r as chatArchive, s as collapseChatEvents } from "../../_chunks/chat-archive-DavfKJDI.mjs";
|
|
10
|
+
import { xt as reportTelegramError } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import { deliveries, runs, turns } from "eve/events";
|
|
13
13
|
import { defineState } from "eve/context";
|
|
@@ -167,7 +167,13 @@ export interface RecordOptions {
|
|
|
167
167
|
* none of is recorded too, without members, in the workspace chat store. A message the archive
|
|
168
168
|
* holds by its provider id is skipped.
|
|
169
169
|
*/
|
|
170
|
-
export declare function recordSentOutside(archive: ChatArchive, message: Omit<RecordedMessage, "participantIds" | "direction"
|
|
170
|
+
export declare function recordSentOutside(archive: ChatArchive, message: Omit<RecordedMessage, "participantIds" | "direction"> & {
|
|
171
|
+
/**
|
|
172
|
+
* The members who read it, in a chat several people share, such as an email thread; by
|
|
173
|
+
* default those of the chat's latest message.
|
|
174
|
+
*/
|
|
175
|
+
readonly participantIds?: ReadonlyArray<string>;
|
|
176
|
+
}, options?: RecordOptions): Promise<SentOutsideOutcome>;
|
|
171
177
|
/**
|
|
172
178
|
* Records a person's message the agent cannot read, such as a contact card on a channel that
|
|
173
179
|
* reads only text and files, in the chat the agent has with them, by the same rule as
|
|
@@ -211,6 +217,8 @@ export declare function recordUnadmittedMessage(archive: ChatArchive, message: U
|
|
|
211
217
|
export declare function recordHandledMessage(archive: ChatArchive, input: {
|
|
212
218
|
readonly chat: AdmittedChat;
|
|
213
219
|
readonly memberId: string;
|
|
220
|
+
/** The members who read it, in a chat several people share; by default its person. */
|
|
221
|
+
readonly participantIds?: ReadonlyArray<string>;
|
|
214
222
|
/** The person's account at the provider. */
|
|
215
223
|
readonly senderId: string | null;
|
|
216
224
|
readonly senderName?: string | null;
|
|
@@ -4,7 +4,7 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
import {
|
|
7
|
+
import { a as chatEvent, g as UNVERIFIED, p as storeOf, w as storedFiles } from "../../_chunks/chat-archive-DavfKJDI.mjs";
|
|
8
8
|
const MAXIMUM_PARTS = 20;
|
|
9
9
|
const PART_BOUNDS = {
|
|
10
10
|
text: 1024,
|
|
@@ -209,7 +209,7 @@ async function recordInChat(archive, message, options) {
|
|
|
209
209
|
if (options.record !== "all" || await storeOf(archive) === void 0) return "no_chat";
|
|
210
210
|
await recordChatMessage(archive, {
|
|
211
211
|
...message,
|
|
212
|
-
participantIds: []
|
|
212
|
+
participantIds: message.participantIds ?? []
|
|
213
213
|
});
|
|
214
214
|
return "recorded";
|
|
215
215
|
}
|
|
@@ -221,7 +221,7 @@ async function recordInChat(archive, message, options) {
|
|
|
221
221
|
if (known !== void 0) return "known";
|
|
222
222
|
await recordChatMessage(archive, {
|
|
223
223
|
...message,
|
|
224
|
-
participantIds: latest.participantIds
|
|
224
|
+
participantIds: message.participantIds ?? latest.participantIds
|
|
225
225
|
});
|
|
226
226
|
return "recorded";
|
|
227
227
|
}
|
|
@@ -263,7 +263,7 @@ async function recordHandledMessage(archive, input) {
|
|
|
263
263
|
provider: chat.channel,
|
|
264
264
|
chatId: chat.chatId,
|
|
265
265
|
threadId: chat.threadId ?? null,
|
|
266
|
-
participantIds: [input.memberId],
|
|
266
|
+
participantIds: input.participantIds ?? [input.memberId],
|
|
267
267
|
eventId,
|
|
268
268
|
direction: "inbound",
|
|
269
269
|
by: "human",
|
|
@@ -294,7 +294,7 @@ async function recordHandledMessage(archive, input) {
|
|
|
294
294
|
chatId: chat.chatId,
|
|
295
295
|
chatType: "private",
|
|
296
296
|
threadId: chat.threadId === void 0 || chat.threadId === "" ? null : chat.threadId,
|
|
297
|
-
participantIds: [input.memberId],
|
|
297
|
+
participantIds: input.participantIds ?? [input.memberId],
|
|
298
298
|
senderId: input.senderId,
|
|
299
299
|
messageId: input.messageId,
|
|
300
300
|
kind: "decision",
|
|
@@ -22,9 +22,10 @@ export declare function sessionKind(context: {
|
|
|
22
22
|
/**
|
|
23
23
|
* A member's chat, kept under the chat its channel stamped, by the channel's name: the same
|
|
24
24
|
* coordinates its replies, attachments, reviews and inbox use. An email chat is one Gmail thread
|
|
25
|
-
* with one person,
|
|
26
|
-
*
|
|
27
|
-
*
|
|
25
|
+
* with one person, or of everyone in it, each message read by the members the principal names, a
|
|
26
|
+
* WhatsApp chat one person's thread, a Slack direct message one chat whatever thread a message is
|
|
27
|
+
* in, a thread in a Slack channel the chat of everyone in it, and a workspace channel's chat one
|
|
28
|
+
* person's. Undefined for Telegram, which keys its chats from its updates, a
|
|
28
29
|
* web chat, and a session without a member.
|
|
29
30
|
*/
|
|
30
31
|
export declare function stampedChat(principal: SessionAuthContext | null | undefined): {
|
|
@@ -39,7 +40,7 @@ export declare function stampedChat(principal: SessionAuthContext | null | undef
|
|
|
39
40
|
chatId: string;
|
|
40
41
|
chatType: "private";
|
|
41
42
|
threadId: string | null;
|
|
42
|
-
participantIds: string[];
|
|
43
|
+
participantIds: readonly string[];
|
|
43
44
|
senderId: string | null;
|
|
44
45
|
} | undefined;
|
|
45
46
|
export declare function chatCoordinates(context: {
|
|
@@ -48,6 +49,13 @@ export declare function chatCoordinates(context: {
|
|
|
48
49
|
};
|
|
49
50
|
readonly channel: RuntimeContext["channel"];
|
|
50
51
|
}): {
|
|
52
|
+
provider: string;
|
|
53
|
+
chatId: string;
|
|
54
|
+
chatType: "private";
|
|
55
|
+
threadId: string | null;
|
|
56
|
+
participantIds: readonly string[];
|
|
57
|
+
senderId: string | null;
|
|
58
|
+
} | {
|
|
51
59
|
provider: string;
|
|
52
60
|
chatId: string;
|
|
53
61
|
chatType: "private" | "group" | "channel";
|
|
@@ -5,10 +5,10 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { n as contentText, t as CONTENT_CAPS } from "../../_chunks/content-cDtVnr8Y.mjs";
|
|
8
|
-
import { a as chatEvent,
|
|
8
|
+
import { a as chatEvent, f as sessionFailureEventId, m as summarizeArguments, p as storeOf, r as chatArchive } from "../../_chunks/chat-archive-DavfKJDI.mjs";
|
|
9
9
|
import { agentTaskIdOf } from "./agent-task.mjs";
|
|
10
10
|
import { revisionOf } from "./review/revision.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { Bt as participantsOf, Ft as chatAddressOf, It as chatChannel, i as memberIdOf, ot as guestIdOf } from "../../_chunks/principal-CVV9C_nO.mjs";
|
|
12
12
|
import { keyChannel, principalChannel } from "./channel-scope.mjs";
|
|
13
13
|
import { parseAddress } from "./telegram/sessions.mjs";
|
|
14
14
|
import { completionKind } from "./telegram/silent.mjs";
|
|
@@ -37,7 +37,7 @@ function stampedChat(principal) {
|
|
|
37
37
|
chatId: chat.chatId,
|
|
38
38
|
chatType: "private",
|
|
39
39
|
threadId: chat.provider === "slack" || chat.threadId === "" ? null : chat.threadId,
|
|
40
|
-
participantIds: [memberId],
|
|
40
|
+
participantIds: participantsOf(principal) ?? [memberId],
|
|
41
41
|
senderId: chat.peer ?? null
|
|
42
42
|
};
|
|
43
43
|
}
|
|
@@ -110,6 +110,12 @@ export interface MessageInput {
|
|
|
110
110
|
readonly sessionId?: string;
|
|
111
111
|
readonly turnId?: string;
|
|
112
112
|
readonly meta?: unknown;
|
|
113
|
+
/**
|
|
114
|
+
* History a channel read from its provider, from before it recorded the chat, such as a Gmail
|
|
115
|
+
* thread's earlier mail: no session reads it as new. Never a send. An ontology service released
|
|
116
|
+
* before it refuses it.
|
|
117
|
+
*/
|
|
118
|
+
readonly imported?: true;
|
|
113
119
|
}
|
|
114
120
|
interface Target {
|
|
115
121
|
readonly channel: string;
|
|
@@ -4,4 +4,4 @@ import { createRequire as __eveCreateRequire } from "node:module";
|
|
|
4
4
|
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
|
-
export { N as CONFIRMATION_TTL_MS, P as actionApproval, F as confirmations, I as inputHash, L as needsConfirmation } from "../../_chunks/principal-
|
|
7
|
+
export { N as CONFIRMATION_TTL_MS, P as actionApproval, F as confirmations, I as inputHash, L as needsConfirmation } from "../../_chunks/principal-CVV9C_nO.mjs";
|