@segmentstream/agent 0.65.3 → 0.66.1
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 +34 -0
- package/README.md +9 -4
- package/dist/_chunks/{build-metadata-DrMmK2Ue.mjs → build-metadata-DImVjzhf.mjs} +1 -1
- package/dist/_chunks/{principal-CDPJQgPO.mjs → principal-Gd5SR1Wv.mjs} +12 -12
- package/dist/extension/channels/slack.mjs +7 -1
- package/dist/extension/config.d.ts +10 -0
- package/dist/extension/config.mjs +8 -1
- package/dist/extension/connections/ontology.mjs +1 -1
- package/dist/extension/hooks/authorization.mjs +1 -1
- package/dist/extension/instructions/persona.mjs +1 -1
- package/dist/extension/lib/actor.mjs +1 -1
- 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.mjs +1 -1
- package/dist/extension/lib/chat-context.mjs +1 -1
- package/dist/extension/lib/chat-recorder.mjs +1 -1
- package/dist/extension/lib/confirmations.mjs +1 -1
- package/dist/extension/lib/customer-text-safety.d.ts +22 -0
- package/dist/extension/lib/customer-text-safety.mjs +26 -9
- package/dist/extension/lib/email/attachments-send.mjs +1 -1
- package/dist/extension/lib/email/channel.mjs +1 -1
- package/dist/extension/lib/guest-usage.mjs +1 -1
- package/dist/extension/lib/inbound-media/files.mjs +1 -1
- package/dist/extension/lib/inbound-media/index.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/hold.d.ts +4 -1
- package/dist/extension/lib/review/hold.mjs +6 -9
- package/dist/extension/lib/review/reply.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.d.ts +5 -1
- package/dist/extension/lib/slack/adapter.mjs +10 -3
- package/dist/extension/lib/slack/attachments-send.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.d.ts +3 -0
- package/dist/extension/lib/telegram/attachments-send.mjs +2 -2
- 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 +1 -1
- package/dist/extension/lib/telegram/customer-text.d.ts +13 -4
- package/dist/extension/lib/telegram/customer-text.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 +1 -1
- 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.d.ts +4 -2
- package/dist/extension/lib/telegram/silent.mjs +3 -3
- package/dist/extension/lib/telegram/structured.mjs +1 -1
- package/dist/extension/lib/telegram/turn-errors.mjs +1 -1
- package/dist/extension/lib/telegram/workspace-action.mjs +1 -1
- 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 +1 -1
- package/dist/extension/lib/whatsapp/attachments-send.mjs +1 -1
- package/dist/extension/lib/whatsapp/files.mjs +1 -1
- package/dist/extension/lib/workspace-channel/attachments-send.mjs +1 -1
- package/dist/extension/lib/workspace-channel/channel.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 +3 -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,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.66.1
|
|
4
|
+
|
|
5
|
+
Pins @segmentstream/ontology 0.139.1.
|
|
6
|
+
|
|
7
|
+
## 0.66.0
|
|
8
|
+
|
|
9
|
+
Replies on Slack can be held for review like those on the other channels. Every channel but the
|
|
10
|
+
web chat, which streams its reply, now holds the replies `review` in `agent/segmentstream.json`
|
|
11
|
+
holds, by the roles of the person the agent replies to: Slack is no longer exempt. A held Slack
|
|
12
|
+
reply is not posted and the thread's status clears; it becomes an `agent_review`, and approving it
|
|
13
|
+
posts it as the agent in the thread it answers, in a channel or in the person's direct message,
|
|
14
|
+
through `chat.slack.connection` in `defineOntology`. As elsewhere, a reviewed Slack chat gets no
|
|
15
|
+
interim messages, and the files and confirmation cards the agent sends are not held. Approval
|
|
16
|
+
posts in the thread with `@segmentstream/ontology` of the same release; an older ontology posts the
|
|
17
|
+
reply outside it.
|
|
18
|
+
|
|
19
|
+
Action required: a workspace whose `review.default` holds replies (mode `always` or `whenUnsure`)
|
|
20
|
+
and whose staff talk to the agent on Slack now has those Slack replies held. To keep sending them
|
|
21
|
+
at once, give each staff role `{ "mode": "never" }` in `review.byRole`, ahead of any reviewed role
|
|
22
|
+
its members also hold, such as
|
|
23
|
+
`"review": { "byRole": { "staff": { "mode": "never" } }, "default": { "mode": "always" } }`. To
|
|
24
|
+
approve the Slack replies it does hold, declare `chat.slack.connection` in `defineOntology`.
|
|
25
|
+
|
|
26
|
+
A Telegram channel can let the agent's texts name identifiers: `channels.telegram.identifiers`
|
|
27
|
+
(or `identifiers` on any channel of kind `telegram`) is `"block"` by default, which keeps today's
|
|
28
|
+
check, and `"allow"` delivers replies, captions and button labels that name a snake_case word
|
|
29
|
+
such as `ORD_A12` or `utm_source`, a UUID, a ULID-shaped word, a bare hex id, a brace or a
|
|
30
|
+
`double__underscored` name, which `"block"` replaces whole with the workspace's
|
|
31
|
+
`texts.notice.response`. Credential-bearing links, `hq:` operation digests, errors, stack traces,
|
|
32
|
+
code fences and raw JSON are replaced either way, and link destinations, workspace texts in
|
|
33
|
+
`segmentstream.json` and confirmation cards are still checked in full.
|
|
34
|
+
|
|
35
|
+
Pins @segmentstream/ontology 0.139.0.
|
|
36
|
+
|
|
3
37
|
## 0.65.3
|
|
4
38
|
|
|
5
39
|
Pins @segmentstream/ontology 0.138.0.
|
package/README.md
CHANGED
|
@@ -128,6 +128,7 @@ See [Sandbox](#sandbox).
|
|
|
128
128
|
| `channels.telegram.additionalOwnOrigins` | `[]` | Additional exact HTTP(S) workspace origins, including local ports; no paths or credentials. |
|
|
129
129
|
| `channels.telegram.appLinks` | `"web"` | `"miniApp"` opens links to the app's own pages in the bot's Main Mini App (`t.me/<bot>?startapp=…`) as messages are delivered; see `docs/agent.md` |
|
|
130
130
|
| `channels.telegram.interimMessages` | `false` | `true` delivers the text the model writes before calling tools as its own message, like a reply; see [Telegram answer delivery](#telegram-answer-delivery) |
|
|
131
|
+
| `channels.telegram.identifiers` | `"block"` | `"allow"` lets the agent's Telegram texts name identifiers such as `ORD_A12`, `utm_source` or a UUID; credential links, errors and raw tool output are still replaced; see [Telegram answer delivery](#telegram-answer-delivery) |
|
|
131
132
|
| `channels.<name>.kind` | the name | A channel not named after its kind, such as `sales_whatsapp`, says its kind and takes that kind's settings: several bots, numbers, apps or mailboxes on one agent; see `docs/agent.md`, "Channels by name" |
|
|
132
133
|
| `channels.<name>.receive` | `"webhook"` | A workspace channel (`kind: "custom"`, defined with `defineChannel`): `webhook`, its provider calls it, or `poll`, the platform wakes it every `checkAfterMinutes`; see `docs/agent.md`, "Workspace channels" |
|
|
133
134
|
| `channels.<name>.secret` | none | A workspace channel's workspace secret, which its `verify` checks deliveries against with `signedWith` or `matches`; only the platform reads it |
|
|
@@ -164,9 +165,9 @@ in the workspace agent guide.
|
|
|
164
165
|
|
|
165
166
|
## Reply review
|
|
166
167
|
|
|
167
|
-
`review` says, per role of the person the agent replies to, who sends its replies on
|
|
168
|
-
|
|
169
|
-
`{ "mode": "always" }` (a member reviews every reply) or
|
|
168
|
+
`review` says, per role of the person the agent replies to, who sends its replies on every
|
|
169
|
+
channel but the web chat, Slack included: `{ "review": { "mode": "never" } }` (the agent, the
|
|
170
|
+
default), `{ "mode": "always" }` (a member reviews every reply) or
|
|
170
171
|
`{ "mode": "whenUnsure", "minConfidence": 0.9 }` (the decision model judges each reply in its
|
|
171
172
|
chat, with the criteria in `agent/review/<role>.md`, and the agent sends those it is sure
|
|
172
173
|
enough of). A held reply becomes an `agent_review` record of the ontology, which a member
|
|
@@ -700,7 +701,11 @@ current chat; group purpose and document restrictions still apply.
|
|
|
700
701
|
|
|
701
702
|
Agent replies render Markdown as visible text and Telegram entities. Headings, emphasis,
|
|
702
703
|
links, lists, quotations and code are supported; decorative separator lines are removed.
|
|
703
|
-
The customer-text guard checks the rendered prose and link destinations
|
|
704
|
+
The customer-text guard checks the rendered prose and link destinations, and replaces a reply that
|
|
705
|
+
fails with the workspace's `texts.notice.response`. By default it fails prose that names an
|
|
706
|
+
identifier, such as a snake_case word or a UUID; `channels.telegram.identifiers: "allow"` lets
|
|
707
|
+
those through, while credential-bearing links, errors, stack traces and raw tool output still
|
|
708
|
+
fail (see `docs/agent.md`). If rendering fails,
|
|
704
709
|
delivery uses clean plain text. Only an explicit Telegram entity-formatting refusal permits
|
|
705
710
|
a plain-text retry; timeouts and other uncertain outcomes must never trigger an automatic resend.
|
|
706
711
|
Attachment captions use the same rendering and fallback rules.
|
|
@@ -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.66.1";
|
|
8
8
|
function agentBuild(environment = process.env) {
|
|
9
9
|
return {
|
|
10
10
|
agent: version,
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { telegramText, withTelegramTexts } from "../extension/lib/telegram/texts.mjs";
|
|
8
|
-
import { isTechnicalText } from "../extension/lib/customer-text-safety.mjs";
|
|
8
|
+
import { isTechnicalText, isUnsafeText } from "../extension/lib/customer-text-safety.mjs";
|
|
9
9
|
import { miniAppLinks, originalLinkPreview, withMiniAppLinks } from "../extension/lib/telegram/app-links.mjs";
|
|
10
10
|
import { CHANNEL_NAME, admissionLimitsOf } from "../extension/config.mjs";
|
|
11
11
|
import { appOrigin } from "../extension/lib/environment.mjs";
|
|
@@ -155,14 +155,14 @@ function failureText(_errorId, kind = "failed", _locale = currentLocale(), fallb
|
|
|
155
155
|
const copy = customerCopy(_locale);
|
|
156
156
|
return copy[kind] ?? (kind === "modelBudgetExceeded" || kind === "modelUnavailable" ? copy[fallback] : void 0) ?? (kind === "cancelled" ? "⏹" : "⚠️");
|
|
157
157
|
}
|
|
158
|
-
function customerText(text, locale = currentLocale()) {
|
|
159
|
-
if (!
|
|
158
|
+
function customerText(text, locale = currentLocale(), identifiers = "block") {
|
|
159
|
+
if (!isUnsafeText(text, identifiers)) return text;
|
|
160
160
|
return failureText(reportTelegramError("technical_text_blocked", { text }), "response", locale);
|
|
161
161
|
}
|
|
162
|
-
function customerMessage(text, locale = currentLocale()) {
|
|
163
|
-
return guardedCustomerMessage(text, locale);
|
|
162
|
+
function customerMessage(text, locale = currentLocale(), identifiers = "block") {
|
|
163
|
+
return guardedCustomerMessage(text, locale, identifiers);
|
|
164
164
|
}
|
|
165
|
-
function guardedCustomerMessage(text, locale, blocked) {
|
|
165
|
+
function guardedCustomerMessage(text, locale, identifiers, blocked) {
|
|
166
166
|
let message;
|
|
167
167
|
try {
|
|
168
168
|
message = telegramMarkdown(text);
|
|
@@ -174,7 +174,7 @@ function guardedCustomerMessage(text, locale, blocked) {
|
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
const links = message.entities.flatMap((entity) => entity.url === void 0 ? [] : [entity.url]);
|
|
177
|
-
const visible = customerText(message.text, locale);
|
|
177
|
+
const visible = customerText(message.text, locale, identifiers);
|
|
178
178
|
if (visible !== message.text) {
|
|
179
179
|
blocked?.();
|
|
180
180
|
return {
|
|
@@ -223,7 +223,7 @@ function linkDestinations(body) {
|
|
|
223
223
|
...Array.isArray(markup?.inline_keyboard) ? markup.inline_keyboard.flatMap(records) : []
|
|
224
224
|
].flatMap((item) => typeof item.url === "string" ? [item.url] : []);
|
|
225
225
|
}
|
|
226
|
-
function safeTelegramFetch(fetchImpl, scope = "telegram", previews = {}, appLinks) {
|
|
226
|
+
function safeTelegramFetch(fetchImpl, scope = "telegram", previews = {}, appLinks, identifiers = "block") {
|
|
227
227
|
const methods = new Set([
|
|
228
228
|
"sendMessage",
|
|
229
229
|
"editMessageText",
|
|
@@ -255,10 +255,10 @@ function safeTelegramFetch(fetchImpl, scope = "telegram", previews = {}, appLink
|
|
|
255
255
|
} : Array.isArray(existing) ? {
|
|
256
256
|
text: body[field],
|
|
257
257
|
entities: existing
|
|
258
|
-
} : guardedCustomerMessage(body[field], currentLocale(), () => {
|
|
258
|
+
} : guardedCustomerMessage(body[field], currentLocale(), identifiers, () => {
|
|
259
259
|
textBlocked = true;
|
|
260
260
|
});
|
|
261
|
-
const guarded = customerText(message.text);
|
|
261
|
+
const guarded = customerText(message.text, currentLocale(), identifiers);
|
|
262
262
|
const unsafeLink = message.entities.some((entity) => typeof entity.url === "string" && isTechnicalText(entity.url));
|
|
263
263
|
textBlocked ||= guarded !== message.text || unsafeLink;
|
|
264
264
|
body[field] = unsafeLink ? failureText(reportTelegramError("unsafe_entity_link", new Error("Credential-bearing link refused.")), "response") : guarded;
|
|
@@ -268,7 +268,7 @@ function safeTelegramFetch(fetchImpl, scope = "telegram", previews = {}, appLink
|
|
|
268
268
|
}
|
|
269
269
|
if (Array.isArray(body.media)) body.media = body.media.map((item) => ({
|
|
270
270
|
...item,
|
|
271
|
-
...typeof item.caption === "string" ? { caption: customerText(item.caption) } : {}
|
|
271
|
+
...typeof item.caption === "string" ? { caption: customerText(item.caption, currentLocale(), identifiers) } : {}
|
|
272
272
|
}));
|
|
273
273
|
const replyTo = deliveryLocale.getStore()?.replyTo ?? currentInboundRequest()?.replyTo;
|
|
274
274
|
const replyChat = deliveryLocale.getStore()?.chatId ?? currentInboundRequest()?.chatId;
|
|
@@ -280,7 +280,7 @@ function safeTelegramFetch(fetchImpl, scope = "telegram", previews = {}, appLink
|
|
|
280
280
|
if (Array.isArray(markup?.inline_keyboard)) {
|
|
281
281
|
if ((textBlocked || typeof body.text === "string" && body.text.length > 4096) && markup.inline_keyboard.some((row) => row.some((button) => typeof button.callback_data === "string" && button.callback_data.startsWith("ss-confirm:")))) throw new Error("Approval buttons require the complete, safe confirmation text.");
|
|
282
282
|
const rows = markup.inline_keyboard.map((row) => row.filter((button) => {
|
|
283
|
-
if (typeof button.text !== "string" || !
|
|
283
|
+
if (typeof button.text !== "string" || !isUnsafeText(button.text, identifiers)) return true;
|
|
284
284
|
reportTelegramError("technical_button_label_blocked", { text: button.text });
|
|
285
285
|
return false;
|
|
286
286
|
})).filter((row) => row.length > 0);
|
|
@@ -7,10 +7,16 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { channelOf } from "../config.mjs";
|
|
8
8
|
import segmentstream from "../extension.mjs";
|
|
9
9
|
import { segmentstreamSlack } from "../lib/slack/adapter.mjs";
|
|
10
|
+
import { decide } from "eve/ai";
|
|
10
11
|
var slack_default = segmentstreamSlack({
|
|
11
12
|
settings: (name) => channelOf(segmentstream.config.channels, "slack", name),
|
|
12
13
|
admission: () => segmentstream.config,
|
|
13
14
|
groups: () => segmentstream.config.groups,
|
|
14
|
-
models: () => segmentstream.config.models
|
|
15
|
+
models: () => segmentstream.config.models,
|
|
16
|
+
review: {
|
|
17
|
+
settings: () => segmentstream.config.review,
|
|
18
|
+
decide: (options) => decide(options),
|
|
19
|
+
model: () => segmentstream.config.models.decision
|
|
20
|
+
}
|
|
15
21
|
});
|
|
16
22
|
export { slack_default as default };
|
|
@@ -3,6 +3,7 @@ import { type GroupPolicy } from "./lib/group-routing/policy.js";
|
|
|
3
3
|
import { type StructuredInbound } from "./lib/telegram/structured-settings.js";
|
|
4
4
|
import type { WorkspaceActionHook } from "./lib/telegram/workspace-action.js";
|
|
5
5
|
import { type TelegramTexts } from "./lib/telegram/texts.js";
|
|
6
|
+
import { type IdentifierPolicy } from "./lib/customer-text-safety.js";
|
|
6
7
|
import type { AttachmentLifecycle } from "./lib/telegram/lifecycle.js";
|
|
7
8
|
import { type TelegramAppLinks } from "./lib/telegram/app-links.js";
|
|
8
9
|
import { type PersonaSettings } from "./personas.js";
|
|
@@ -237,6 +238,13 @@ export interface TelegramChannelInput {
|
|
|
237
238
|
* like a reply. Off when absent: only final replies are delivered.
|
|
238
239
|
*/
|
|
239
240
|
readonly interimMessages?: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Whether the agent's texts, captions and button labels may name identifiers, such as order
|
|
243
|
+
* numbers, snake_case keys and UUIDs: `block` (default) replaces a text that does with the
|
|
244
|
+
* `texts.notice.response` notice, `allow` delivers it. Credential links, errors, stack traces
|
|
245
|
+
* and raw tool output are replaced either way.
|
|
246
|
+
*/
|
|
247
|
+
readonly identifiers?: string;
|
|
240
248
|
readonly inbound?: Omit<StructuredInbound, "contextVersion" | "kinds"> & {
|
|
241
249
|
readonly kinds: ReadonlyArray<string>;
|
|
242
250
|
readonly contextVersion: number;
|
|
@@ -385,6 +393,8 @@ export interface TelegramSettings {
|
|
|
385
393
|
readonly appLinks?: Exclude<TelegramAppLinks, "web">;
|
|
386
394
|
/** Whether interim messages are on; validation sets it only when they are. */
|
|
387
395
|
readonly interimMessages?: boolean;
|
|
396
|
+
/** `allow` when the agent's texts may name identifiers; validation sets it only then. */
|
|
397
|
+
readonly identifiers?: Exclude<IdentifierPolicy, "block">;
|
|
388
398
|
readonly attachmentLifecycle?: AttachmentLifecycle;
|
|
389
399
|
readonly menuButton?: {
|
|
390
400
|
readonly text: LocalizedText;
|
|
@@ -8,7 +8,7 @@ import { effectiveGroupPolicy, groupPolicy, ignoredGroupSettings, inapplicableGr
|
|
|
8
8
|
import { localizedText as localizedText$1 } from "./lib/admission.mjs";
|
|
9
9
|
import { STRUCTURED_KINDS } from "./lib/telegram/structured-settings.mjs";
|
|
10
10
|
import { TELEGRAM_TEXT_KEYS } from "./lib/telegram/texts.mjs";
|
|
11
|
-
import { isTechnicalText } from "./lib/customer-text-safety.mjs";
|
|
11
|
+
import { IDENTIFIER_POLICIES, isTechnicalText } from "./lib/customer-text-safety.mjs";
|
|
12
12
|
import { TELEGRAM_APP_LINKS } from "./lib/telegram/app-links.mjs";
|
|
13
13
|
import { inlineConventionFiles } from "./conventions.mjs";
|
|
14
14
|
import { personaSettings } from "./personas.mjs";
|
|
@@ -443,6 +443,7 @@ function telegramSettings(value, issues, path = ["channels", "telegram"]) {
|
|
|
443
443
|
"additionalOwnOrigins",
|
|
444
444
|
"appLinks",
|
|
445
445
|
"interimMessages",
|
|
446
|
+
"identifiers",
|
|
446
447
|
"attachmentLifecycle",
|
|
447
448
|
"menuButton",
|
|
448
449
|
"callbacks",
|
|
@@ -508,6 +509,11 @@ function telegramSettings(value, issues, path = ["channels", "telegram"]) {
|
|
|
508
509
|
message: "must be true or false",
|
|
509
510
|
path: [...path, "interimMessages"]
|
|
510
511
|
});
|
|
512
|
+
const identifiers = telegram.identifiers === void 0 ? "block" : telegram.identifiers;
|
|
513
|
+
if (!IDENTIFIER_POLICIES.some((policy) => policy === identifiers)) issues.push({
|
|
514
|
+
message: "must be \"block\" or \"allow\"",
|
|
515
|
+
path: [...path, "identifiers"]
|
|
516
|
+
});
|
|
511
517
|
const inboundConfig = section({
|
|
512
518
|
value: telegram.inbound,
|
|
513
519
|
path: [...path, "inbound"],
|
|
@@ -579,6 +585,7 @@ function telegramSettings(value, issues, path = ["channels", "telegram"]) {
|
|
|
579
585
|
additionalOwnOrigins,
|
|
580
586
|
...appLinks === "miniApp" ? { appLinks: "miniApp" } : {},
|
|
581
587
|
...interimMessages === true ? { interimMessages: true } : {},
|
|
588
|
+
...identifiers === "allow" ? { identifiers: "allow" } : {},
|
|
582
589
|
...menuText === void 0 ? {} : { menuButton: { text: menuText } },
|
|
583
590
|
...lifecycle === void 0 ? {} : { attachmentLifecycle: {
|
|
584
591
|
entity: String(lifecycle.entity),
|
|
@@ -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-Gd5SR1Wv.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-Gd5SR1Wv.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 { a as rolesOf } from "../../_chunks/principal-
|
|
8
|
+
import { a as rolesOf } from "../../_chunks/principal-Gd5SR1Wv.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-Gd5SR1Wv.mjs";
|
|
@@ -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 { _t as chatChannel, b as agentAttachments, gt as chatAddressOf, i as memberIdOf } from "../../_chunks/principal-
|
|
7
|
+
import { _t as chatChannel, b as agentAttachments, gt as chatAddressOf, i as memberIdOf } from "../../_chunks/principal-Gd5SR1Wv.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 { Ot as failureText, _ as AttachmentError, gt as chatAddressOf } from "../../_chunks/principal-
|
|
8
|
+
import { Ot as failureText, _ as AttachmentError, gt as chatAddressOf } from "../../_chunks/principal-Gd5SR1Wv.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, mt as CHAT_HEADER, v as EARLIER_CHAT_HEADER, y as MAXIMUM_ATTACHMENT_BYTES, ht as SESSION_HEADER, b as agentAttachments, x as attachmentUrl, S as fetchStoredAttachment, C as parseAttachmentUrl } from "../../_chunks/principal-
|
|
7
|
+
export { h as ATTACHMENT_TTL_HOURS, g as ATTACHMENT_URL_PROTOCOL, _ as AttachmentError, mt as CHAT_HEADER, v as EARLIER_CHAT_HEADER, y as MAXIMUM_ATTACHMENT_BYTES, ht as SESSION_HEADER, b as agentAttachments, x as attachmentUrl, S as fetchStoredAttachment, C as parseAttachmentUrl } from "../../_chunks/principal-Gd5SR1Wv.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-DImVjzhf.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 { pt as CHAT_ATTRIBUTE, mt as CHAT_HEADER, ht as SESSION_HEADER, gt as chatAddressOf, _t as chatChannel, vt as chatHeaders, yt as isSameChat, bt as withChatAddress, xt as workspaceIdentityProvider } from "../../_chunks/principal-
|
|
7
|
+
export { pt as CHAT_ATTRIBUTE, mt as CHAT_HEADER, ht as SESSION_HEADER, gt as chatAddressOf, _t as chatChannel, vt as chatHeaders, yt as isSameChat, bt as withChatAddress, xt as workspaceIdentityProvider } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { agentTaskIdOf } from "./agent-task.mjs";
|
|
8
8
|
import { chatCoordinates, sessionKind } from "./chat-recorder.mjs";
|
|
9
9
|
import { archiveSequence, chatArchive, chatAuthor, collapseChatEvents, topicContext } from "./chat-archive.mjs";
|
|
10
|
-
import { At as reportTelegramError } from "../../_chunks/principal-
|
|
10
|
+
import { At as reportTelegramError } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
12
12
|
import { deliveries, runs, turns } from "eve/events";
|
|
13
13
|
import { defineState } from "eve/context";
|
|
@@ -8,7 +8,7 @@ import { n as contentText, t as CONTENT_CAPS } from "../../_chunks/content-cDtVn
|
|
|
8
8
|
import { chatArchive, chatEvent, sessionFailureEventId, summarizeArguments } from "./chat-archive.mjs";
|
|
9
9
|
import { agentTaskIdOf } from "./agent-task.mjs";
|
|
10
10
|
import { revisionOf } from "./review/revision.mjs";
|
|
11
|
-
import { _t as chatChannel, gt as chatAddressOf, i as memberIdOf, ot as guestIdOf } from "../../_chunks/principal-
|
|
11
|
+
import { _t as chatChannel, gt as chatAddressOf, i as memberIdOf, ot as guestIdOf } from "../../_chunks/principal-Gd5SR1Wv.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";
|
|
@@ -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-Gd5SR1Wv.mjs";
|
|
@@ -1,3 +1,25 @@
|
|
|
1
1
|
/** The text with each email address read as a word, for checks that would mistake one for a link. */
|
|
2
2
|
export declare function withoutEmailAddresses(text: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Whether a channel's visible text may name identifiers: `block` (the default) keeps them out;
|
|
5
|
+
* `allow` lets them through, such as a workspace's order numbers. Leaks are blocked either way.
|
|
6
|
+
*/
|
|
7
|
+
export declare const IDENTIFIER_POLICIES: readonly ["block", "allow"];
|
|
8
|
+
export type IdentifierPolicy = (typeof IDENTIFIER_POLICIES)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Whether the text leaks what no reader is shown, whatever the workspace allows: a
|
|
11
|
+
* credential-bearing link, the `hq:` operation digest, an error, a stack trace or raw tool output.
|
|
12
|
+
*/
|
|
13
|
+
export declare function hasLeak(text: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the text names an identifier: a UUID, a ULID-shaped word, a bare hex id or hash, a
|
|
16
|
+
* brace, a `double__underscored` name or a snake_case word.
|
|
17
|
+
*/
|
|
18
|
+
export declare function hasIdentifier(text: string): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Both checks: what workspace texts in configuration, confirmation cards and, by default, every
|
|
21
|
+
* Telegram text must pass.
|
|
22
|
+
*/
|
|
3
23
|
export declare function isTechnicalText(text: string): boolean;
|
|
24
|
+
/** The check of a channel's visible text: `allow` lets identifiers through, never a leak. */
|
|
25
|
+
export declare function isUnsafeText(text: string, identifiers?: IdentifierPolicy): boolean;
|
|
@@ -8,22 +8,39 @@ const EMAIL_ADDRESS = new RegExp(String.raw`(?<![\p{L}\p{N}._%+-])[\p{L}\p{N}._%
|
|
|
8
8
|
function withoutEmailAddresses(text) {
|
|
9
9
|
return text.replace(EMAIL_ADDRESS, "address");
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const IDENTIFIER_POLICIES = ["block", "allow"];
|
|
12
|
+
const IDENTIFIER_PATTERNS = [
|
|
12
13
|
/^\s*(?=[0-9a-f]*[a-f])[0-9a-f]{8}\s*$/iu,
|
|
13
|
-
/[{}]
|
|
14
|
-
/\b
|
|
14
|
+
/[{}]/u,
|
|
15
|
+
/\b[0-9a-f]{64}\b/iu,
|
|
15
16
|
/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/iu,
|
|
16
17
|
/\b[0-9a-hjkmnp-tv-z]{26}\b/iu,
|
|
17
|
-
/\b\w+__\w+/u
|
|
18
|
+
/\b\w+__\w+/u
|
|
19
|
+
];
|
|
20
|
+
const LEAK_PATTERNS = [
|
|
21
|
+
/```/u,
|
|
18
22
|
/\b(?:Serialization|Type|Reference|Syntax|Tool|Provider|API|Workflow|InternalServer)Error\b/u,
|
|
19
23
|
/\bError:\s|(?:^|\n)\s*at\s+\S+|\b(?:stack trace|traceback|SQLSTATE|node_modules)\b/imu,
|
|
20
24
|
/\b(?:duplicate key|ECONN\w+|HTTP [45]\d\d)\b/iu,
|
|
21
|
-
/\[\s*(?:"[^"]*"|\d+|true|false|null)\s*[,\]]/u
|
|
25
|
+
/\[\s*(?:"[^"]*"|\d+|true|false|null)\s*[,\]]/u,
|
|
26
|
+
/\{\s*"[^"]*"\s*:/u
|
|
22
27
|
];
|
|
23
|
-
function
|
|
28
|
+
function withoutLinks(text) {
|
|
29
|
+
return text.replace(/https?:\/\/[^\s)<>]+/giu, "link");
|
|
30
|
+
}
|
|
31
|
+
function hasLeak(text) {
|
|
24
32
|
if (/\bhq:[0-9a-f]{64}\b/iu.test(text) || /https?:\/\/[^\s/@]+:[^\s/@]+@|[?&](?:token|access_token|api_key|secret|password)=/iu.test(text)) return true;
|
|
25
|
-
|
|
33
|
+
return LEAK_PATTERNS.some((pattern) => pattern.test(withoutLinks(text)));
|
|
34
|
+
}
|
|
35
|
+
function hasIdentifier(text) {
|
|
36
|
+
const visible = withoutLinks(text);
|
|
26
37
|
const prose = withoutEmailAddresses(visible.replace(/(?<![\w@])@[a-z][a-z0-9_]{4,31}(?!\w)/giu, "recipient"));
|
|
27
|
-
return
|
|
38
|
+
return IDENTIFIER_PATTERNS.some((pattern) => pattern.test(visible)) || /\b[a-z][a-z0-9]*_[a-z][a-z0-9_]*\b(?!\.[a-z0-9])/iu.test(prose);
|
|
39
|
+
}
|
|
40
|
+
function isTechnicalText(text) {
|
|
41
|
+
return hasLeak(text) || hasIdentifier(text);
|
|
42
|
+
}
|
|
43
|
+
function isUnsafeText(text, identifiers = "block") {
|
|
44
|
+
return identifiers === "allow" ? hasLeak(text) : isTechnicalText(text);
|
|
28
45
|
}
|
|
29
|
-
export { isTechnicalText, withoutEmailAddresses };
|
|
46
|
+
export { IDENTIFIER_POLICIES, hasIdentifier, hasLeak, isTechnicalText, isUnsafeText, withoutEmailAddresses };
|
|
@@ -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 { _ as AttachmentError } from "../../../_chunks/principal-
|
|
7
|
+
import { _ as AttachmentError } from "../../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
8
8
|
import { sendStoredAttachments } from "../attachments-send.mjs";
|
|
9
9
|
import { ConnectionProxyError, connectionProxy } from "../connection-proxy.mjs";
|
|
10
10
|
import { redactDiagnostic } from "../diagnostics.mjs";
|
|
@@ -8,7 +8,7 @@ import { PUBSUB_TOPIC } from "../../config.mjs";
|
|
|
8
8
|
import { admitMessage, localizedText } from "../admission.mjs";
|
|
9
9
|
import { agentToolsAttribute } from "../agent-tools.mjs";
|
|
10
10
|
import { providerChat } from "../attachment-tools.mjs";
|
|
11
|
-
import { S as fetchStoredAttachment, b as agentAttachments, bt as withChatAddress, d as prepareInboundMedia, gt as chatAddressOf, i as memberIdOf, m as turnContent } from "../../../_chunks/principal-
|
|
11
|
+
import { S as fetchStoredAttachment, b as agentAttachments, bt as withChatAddress, d as prepareInboundMedia, gt as chatAddressOf, i as memberIdOf, m as turnContent } from "../../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
12
12
|
import { channelAttributes, currentChannel, currentKey, inHandlerChannels, withNamedRoutes } from "../channel-scope.mjs";
|
|
13
13
|
import { chatArchive, replyEvent } from "../chat-archive.mjs";
|
|
14
14
|
import { recordHandledMessage, recordSentOutside } from "../chat-messages.mjs";
|
|
@@ -6,7 +6,7 @@ __eveDirname(__filename);
|
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { appOrigin } from "./environment.mjs";
|
|
8
8
|
import { runtimeToken } from "./runtime-token.mjs";
|
|
9
|
-
import { ot as guestIdOf } from "../../_chunks/principal-
|
|
9
|
+
import { ot as guestIdOf } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
10
10
|
const GUEST_USAGE_PATH = "/api/ontology/agent/guests/usage";
|
|
11
11
|
const REPORT_TIMEOUT_MS = 5e3;
|
|
12
12
|
function ontologyGuestUsage(options = {}) {
|
|
@@ -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 { f as attachmentsContext, p as storeFiles, m as turnContent } from "../../../_chunks/principal-
|
|
7
|
+
export { f as attachmentsContext, p as storeFiles, m as turnContent } from "../../../_chunks/principal-Gd5SR1Wv.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 { f as attachmentsContext, d as prepareInboundMedia, p as storeFiles, m as turnContent } from "../../../_chunks/principal-
|
|
7
|
+
export { f as attachmentsContext, d as prepareInboundMedia, p as storeFiles, m as turnContent } from "../../../_chunks/principal-Gd5SR1Wv.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 { R as ACT_AS_HEADER, w as actAsHeaders, T as ontologyConnection } from "../../_chunks/principal-
|
|
7
|
+
export { R as ACT_AS_HEADER, w as actAsHeaders, T as ontologyConnection } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
@@ -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 { F as confirmations, H as actorOf, I as inputHash, It as runtimeEnvelope, P as actionApproval, V as actorKey, j as ontologyTools } from "../../_chunks/principal-
|
|
7
|
+
import { F as confirmations, H as actorOf, I as inputHash, It as runtimeEnvelope, P as actionApproval, V as actorKey, j as ontologyTools } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
8
8
|
import { isChatPost } from "./chat-post-confirmation.mjs";
|
|
9
9
|
import { sandboxFile } from "./sandbox-session.mjs";
|
|
10
10
|
import { saveOntologyResult } from "./ontology-result-file.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 { E as OntologyActionNotPermitted, D as OntologyFileUnavailable, O as OntologyToolRejected, k as actionToolName, A as ontologyToolLabels, j as ontologyTools, M as promotionTarget } from "../../_chunks/principal-
|
|
7
|
+
export { E as OntologyActionNotPermitted, D as OntologyFileUnavailable, O as OntologyToolRejected, k as actionToolName, A as ontologyToolLabels, j as ontologyTools, M as promotionTarget } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
@@ -22,7 +22,10 @@ export interface HeldReply {
|
|
|
22
22
|
* the channel has one (WhatsApp's thread id is not a number it sends to), else the chat's id.
|
|
23
23
|
*/
|
|
24
24
|
readonly recipient: string;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The chat's thread or topic, which an approved reply is sent in, such as the Slack thread the
|
|
27
|
+
* reply answers; `""` without one.
|
|
28
|
+
*/
|
|
26
29
|
readonly threadId: string;
|
|
27
30
|
/** The message the reply answers, when the provider replies to one. */
|
|
28
31
|
readonly replyTo: string | null;
|
|
@@ -5,19 +5,16 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { reviewFor } from "../../review.mjs";
|
|
8
|
-
import { a as rolesOf, gt as chatAddressOf, i as memberIdOf } from "../../../_chunks/principal-
|
|
8
|
+
import { a as rolesOf, gt as chatAddressOf, i as memberIdOf } from "../../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
9
9
|
function reviewOf(settings, principal) {
|
|
10
10
|
return reviewFor(settings, rolesOf(principal));
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"email",
|
|
16
|
-
"custom"
|
|
17
|
-
]);
|
|
12
|
+
function holdsReplies(provider) {
|
|
13
|
+
return provider !== "web";
|
|
14
|
+
}
|
|
18
15
|
function repliesReviewed(settings, principal) {
|
|
19
16
|
const provider = chatAddressOf(principal)?.provider;
|
|
20
|
-
return provider !== void 0 &&
|
|
17
|
+
return provider !== void 0 && holdsReplies(provider) && reviewOf(settings, principal).mode !== "never";
|
|
21
18
|
}
|
|
22
19
|
async function reviewOutcome(review, judge, onJudgeFailure = () => void 0) {
|
|
23
20
|
if (review.mode === "never") return { send: true };
|
|
@@ -45,7 +42,7 @@ function heldReply(input) {
|
|
|
45
42
|
const chat = chatAddressOf(input.principal);
|
|
46
43
|
const memberId = memberIdOf(input.principal);
|
|
47
44
|
const replyTo = input.principal?.attributes.replyToMessageId;
|
|
48
|
-
if (chat === void 0 || memberId === void 0 || chat.provider
|
|
45
|
+
if (chat === void 0 || memberId === void 0 || !holdsReplies(chat.provider)) return;
|
|
49
46
|
return {
|
|
50
47
|
key: `${input.sessionId}:${input.partId}`,
|
|
51
48
|
provider: chat.provider,
|
|
@@ -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 { _t as chatChannel, gt as chatAddressOf, i as memberIdOf } from "../../../_chunks/principal-
|
|
7
|
+
import { _t as chatChannel, gt as chatAddressOf, i as memberIdOf } from "../../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
8
8
|
import { chatArchive, chatEvent } from "../chat-archive.mjs";
|
|
9
9
|
import { appOrigin } from "../environment.mjs";
|
|
10
10
|
import { agentReviews } from "./client.mjs";
|
|
@@ -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 { a as rolesOf } from "../../_chunks/principal-
|
|
7
|
+
import { a as rolesOf } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
8
8
|
import { defineDynamic, defineSkill } from "eve/skills";
|
|
9
9
|
function forRoles(roles, skill) {
|
|
10
10
|
if (!Array.isArray(roles) || roles.length === 0 || !roles.every((role) => typeof role === "string" && role.trim() !== "")) throw new TypeError("forRoles() needs at least one role name; a skill for everyone is an ordinary skill file.");
|
|
@@ -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 { Nt as RUNTIME_SOURCE_PROTOCOL, Pt as compatibleRuntimeEnvelope, Ft as principalRuntimeSource, It as runtimeEnvelope, Lt as telegramRuntimeSource } from "../../_chunks/principal-
|
|
7
|
+
export { Nt as RUNTIME_SOURCE_PROTOCOL, Pt as compatibleRuntimeEnvelope, Ft as principalRuntimeSource, It as runtimeEnvelope, Lt as telegramRuntimeSource } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
@@ -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 { R as ACT_AS_HEADER, _ as AttachmentError, ht as SESSION_HEADER, mt as CHAT_HEADER, v as EARLIER_CHAT_HEADER } from "../../_chunks/principal-
|
|
7
|
+
import { R as ACT_AS_HEADER, _ as AttachmentError, ht as SESSION_HEADER, mt as CHAT_HEADER, v as EARLIER_CHAT_HEADER } from "../../_chunks/principal-Gd5SR1Wv.mjs";
|
|
8
8
|
import { fetchFileGrant, transientFileStatus } from "./file-grant.mjs";
|
|
9
9
|
var StoredFileError = class extends AttachmentError {
|
|
10
10
|
filename;
|