@segmentstream/agent 0.34.0 → 0.34.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/README.md +1 -1
- package/dist/_chunks/{build-metadata-rvx1ljR5.mjs → build-metadata-BMjP89Jo.mjs} +1 -1
- package/dist/_chunks/{inbound-request-BQQWCrWl.mjs → inbound-request-DgQB4g1J.mjs} +1 -1
- package/dist/_chunks/{principal-VsmaJp1x.mjs → principal-UlkbLrgQ.mjs} +1 -1
- package/dist/extension/config.d.ts +2 -2
- package/dist/extension/config.mjs +2 -2
- package/dist/extension/hooks/authorization.mjs +1 -1
- package/dist/extension/lib/actor.mjs +1 -1
- package/dist/extension/lib/attachment-tools.mjs +1 -1
- package/dist/extension/lib/build-metadata.mjs +1 -1
- package/dist/extension/lib/chat-context.mjs +1 -1
- package/dist/extension/lib/confirmations.mjs +1 -1
- package/dist/extension/lib/conversation-runtime.mjs +1 -1
- package/dist/extension/lib/group-routing/policy.d.ts +2 -2
- 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/runtime-envelope.d.ts +1 -1
- package/dist/extension/lib/runtime-envelope.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 +2 -2
- package/dist/extension/lib/telegram/callbacks.mjs +2 -2
- package/dist/extension/lib/telegram/chat-post-card.mjs +1 -1
- package/dist/extension/lib/telegram/confirmations.mjs +3 -3
- package/dist/extension/lib/telegram/conversations.mjs +1 -1
- package/dist/extension/lib/telegram/customer-text.d.ts +1 -1
- package/dist/extension/lib/telegram/customer-text.mjs +1 -1
- package/dist/extension/lib/telegram/files.mjs +2 -2
- package/dist/extension/lib/telegram/health.mjs +1 -1
- package/dist/extension/lib/telegram/images.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 +3 -3
- package/dist/extension/lib/telegram/media-policy.mjs +1 -1
- 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/structured.mjs +1 -1
- package/dist/extension/lib/telegram/turn-errors.mjs +2 -2
- package/dist/extension/lib/telegram/voice.mjs +1 -1
- package/dist/extension/model.mjs +1 -1
- package/dist/extension/tools/attachments_promote.mjs +1 -1
- package/dist/extension/tools/questions_ask.mjs +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -327,7 +327,7 @@ client with a member, and it negotiates neither chat posting nor the chat's runt
|
|
|
327
327
|
### Workflow tasks
|
|
328
328
|
|
|
329
329
|
A workflow hands the workspace's agent a prompt with `agentTask` from
|
|
330
|
-
`@segmentstream
|
|
330
|
+
`@segmentstream/ontology/workflows` and waits for its answer
|
|
331
331
|
([the specification](../../docs/agent-tasks-spec.md)). The task runs in an ordinary session of the
|
|
332
332
|
same agent: its instructions, model choice from the principal's roles, tools, guides and sandbox.
|
|
333
333
|
The SDK adds no text to the prompt.
|
|
@@ -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.34.
|
|
7
|
+
var version = "0.34.1";
|
|
8
8
|
function agentBuild(environment = process.env) {
|
|
9
9
|
return {
|
|
10
10
|
agent: version,
|
|
@@ -14,7 +14,7 @@ import { inTelegramSendQueue } from "../extension/lib/telegram/send-queue.mjs";
|
|
|
14
14
|
import { retainDeliveryDiagnostic } from "../extension/lib/telegram/delivery-diagnostics.mjs";
|
|
15
15
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
16
16
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
17
|
-
import { telegramPreviewOptions, telegramTextLinks } from "@segmentstream
|
|
17
|
+
import { telegramPreviewOptions, telegramTextLinks } from "@segmentstream/ontology/telegram";
|
|
18
18
|
const deliveryLocale = new AsyncLocalStorage();
|
|
19
19
|
function withDeliveryLocale(locale, run, threadId, replyTo, chatId) {
|
|
20
20
|
return deliveryLocale.run({
|
|
@@ -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 { n as currentInboundRequest } from "./inbound-request-
|
|
7
|
+
import { n as currentInboundRequest } from "./inbound-request-DgQB4g1J.mjs";
|
|
8
8
|
import "../extension/lib/agent-task.mjs";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
function telegramRuntimeSource(message, files, callbackQueryId) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type GroupPolicyInput } from "@segmentstream
|
|
1
|
+
import { type GroupPolicyInput } from "@segmentstream/ontology/groups";
|
|
2
2
|
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
6
|
import type { AttachmentLifecycle } from "./lib/telegram/lifecycle.js";
|
|
7
|
-
import { type TelegramLinkPreviews } from "@segmentstream
|
|
7
|
+
import { type TelegramLinkPreviews } from "@segmentstream/ontology/telegram";
|
|
8
8
|
export declare const TELEGRAM_POLICIES: readonly ["mention", "smart"];
|
|
9
9
|
/**
|
|
10
10
|
* Smart routing classifies unaddressed group messages. Mention policy observes them
|
|
@@ -10,8 +10,8 @@ import { STRUCTURED_KINDS } from "./lib/telegram/structured-settings.mjs";
|
|
|
10
10
|
import { TELEGRAM_TEXT_KEYS } from "./lib/telegram/texts.mjs";
|
|
11
11
|
import { isTechnicalText } from "./lib/customer-text-safety.mjs";
|
|
12
12
|
import { readFileSync, realpathSync } from "node:fs";
|
|
13
|
-
import { expandGroupFiles, groupPolicyIssues } from "@segmentstream
|
|
14
|
-
import { TELEGRAM_LINK_PREVIEWS, isHttpOrigin } from "@segmentstream
|
|
13
|
+
import { expandGroupFiles, groupPolicyIssues } from "@segmentstream/ontology/groups";
|
|
14
|
+
import { TELEGRAM_LINK_PREVIEWS, isHttpOrigin } from "@segmentstream/ontology/telegram";
|
|
15
15
|
const CONNECTION_KEY = /^[a-z][a-z0-9_]{0,63}$/;
|
|
16
16
|
const TELEGRAM_POLICIES = ["mention", "smart"];
|
|
17
17
|
const DEFAULT_STT_MODEL = "spacexai/grok-stt";
|
|
@@ -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-UlkbLrgQ.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 { AGENT_TASK_HEADER, agentTaskIdOf, taskSecret } from "./agent-task.mjs";
|
|
8
|
-
import { i as memberIdOf, r as identityProviderOf } from "../../_chunks/principal-
|
|
8
|
+
import { i as memberIdOf, r as identityProviderOf } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
9
9
|
import { defineDynamic } from "eve/tools";
|
|
10
10
|
const ACT_AS_HEADER = "X-SegmentStream-Act-As";
|
|
11
11
|
function member(memberId) {
|
|
@@ -10,7 +10,7 @@ import { readSheets, typedTable } from "./attachment-tables.mjs";
|
|
|
10
10
|
import { appOrigin } from "./environment.mjs";
|
|
11
11
|
import { runtimeToken } from "./runtime-token.mjs";
|
|
12
12
|
import { telegramConversation } from "./telegram/files.mjs";
|
|
13
|
-
import { i as memberIdOf } from "../../_chunks/principal-
|
|
13
|
+
import { i as memberIdOf } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
14
14
|
const MAXIMUM_TEXT_CHARACTERS = 5e4;
|
|
15
15
|
const MAXIMUM_INLINE_BYTES = 5242880;
|
|
16
16
|
var AttachmentOwnerError = class extends Error {
|
|
@@ -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-BMjP89Jo.mjs";
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { agentTaskIdOf } from "./agent-task.mjs";
|
|
8
8
|
import { conversationCoordinates } from "./conversation-runtime.mjs";
|
|
9
9
|
import { collapseConversationEvents, conversations, topicContext } from "./conversations.mjs";
|
|
10
|
-
import { p as reportTelegramError } from "../../_chunks/inbound-request-
|
|
10
|
+
import { p as reportTelegramError } from "../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
11
11
|
import { deliveries, runs, turns } from "eve/events";
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
13
13
|
import { defineState } from "eve/context";
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { actorOf, member } from "./actor.mjs";
|
|
8
|
-
import { i as memberIdOf } from "../../_chunks/principal-
|
|
8
|
+
import { i as memberIdOf } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
9
9
|
import { ConfirmationRefused, UnsafeConfirmationTarget } from "./confirmation-description.mjs";
|
|
10
10
|
import { chatPostDigest, isChatPost } from "./chat-post-confirmation.mjs";
|
|
11
11
|
import { confirmationCopy, confirmationCopyIssue, confirmationLocale, renderConfirmation } from "./telegram/confirmation-text.mjs";
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { n as contentText, t as CONTENT_CAPS } from "../../_chunks/content-cDtVnr8Y.mjs";
|
|
8
8
|
import { conversationEvent, conversations, sessionFailureEventId, summarizeArguments } from "./conversations.mjs";
|
|
9
9
|
import { agentTaskIdOf } from "./agent-task.mjs";
|
|
10
|
-
import { i as memberIdOf } from "../../_chunks/principal-
|
|
10
|
+
import { i as memberIdOf } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
11
11
|
import { parseAddress } from "./telegram/sessions.mjs";
|
|
12
12
|
import { completionKind } from "./telegram/silent.mjs";
|
|
13
13
|
import { recordModelServiceAlert } from "./model-service-alert.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GroupPolicyInput, SmartPolicyInput, ChatOverrideInput, Participants } from "@segmentstream
|
|
2
|
-
export type { GroupPolicyInput, SmartPolicyInput, ChatOverrideInput, Participants, } from "@segmentstream
|
|
1
|
+
import type { GroupPolicyInput, SmartPolicyInput, ChatOverrideInput, Participants } from "@segmentstream/ontology/groups";
|
|
2
|
+
export type { GroupPolicyInput, SmartPolicyInput, ChatOverrideInput, Participants, } from "@segmentstream/ontology/groups";
|
|
3
3
|
export declare const LEGACY_INSTRUCTIONS: string;
|
|
4
4
|
export declare const DEFAULT_CRITERIA: {
|
|
5
5
|
observe: string;
|
|
@@ -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 { c as compatibleRuntimeEnvelope, u as runtimeEnvelope } from "../../_chunks/principal-
|
|
7
|
+
import { c as compatibleRuntimeEnvelope, u as runtimeEnvelope } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
8
8
|
import { appOrigin } from "./environment.mjs";
|
|
9
9
|
import { actionApproval, confirmations } from "./confirmations.mjs";
|
|
10
10
|
import { CHAT_POST_ENVELOPE, CHAT_POST_TOOL, chatPostDigest, chatPostOperationId, isChatPost } from "./chat-post-confirmation.mjs";
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { actionApproval, confirmations, inputHash } from "./confirmations.mjs";
|
|
8
8
|
import { isChatPost } from "./chat-post-confirmation.mjs";
|
|
9
9
|
import { ontologyTools } from "./ontology-tools.mjs";
|
|
10
|
-
import { u as runtimeEnvelope } from "../../_chunks/principal-
|
|
10
|
+
import { u as runtimeEnvelope } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
11
11
|
import { sandboxFile } from "./sandbox-session.mjs";
|
|
12
12
|
import { saveOntologyResult } from "./ontology-result-file.mjs";
|
|
13
13
|
import { actorKey, actorOf } from "./actor.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 { c as compatibleRuntimeEnvelope, s as RUNTIME_SOURCE_PROTOCOL, u as runtimeEnvelope } from "../../_chunks/principal-
|
|
7
|
+
import { c as compatibleRuntimeEnvelope, s as RUNTIME_SOURCE_PROTOCOL, u as runtimeEnvelope } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
8
8
|
import "./agent-task.mjs";
|
|
9
9
|
import { actorHeaders, actorKey, actorOf } from "./actor.mjs";
|
|
10
10
|
import { CONFIRMATION_FACTS, CONFIRMATION_PREVIEW_METHOD, ConfirmationRefused, confirmationCard, describeConfirmation, factsConfirmation, object } from "./confirmation-description.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RuntimeSource } from "@segmentstream
|
|
1
|
+
import type { RuntimeSource } from "@segmentstream/ontology";
|
|
2
2
|
import type { SessionAuthContext } from "eve/context";
|
|
3
3
|
import type { TelegramMessage } from "eve/channels/telegram";
|
|
4
4
|
import type { StagedFile } from "./telegram/inbound-request.js";
|
|
@@ -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 { s as RUNTIME_SOURCE_PROTOCOL, c as compatibleRuntimeEnvelope, l as principalRuntimeSource, u as runtimeEnvelope, d as telegramRuntimeSource } from "../../_chunks/principal-
|
|
7
|
+
export { s as RUNTIME_SOURCE_PROTOCOL, c as compatibleRuntimeEnvelope, l as principalRuntimeSource, u as runtimeEnvelope, d as telegramRuntimeSource } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
@@ -6,7 +6,7 @@ __eveDirname(__filename);
|
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { object } from "./confirmation-description.mjs";
|
|
8
8
|
import { OntologyFileUnavailable, ontologyTools } from "./ontology-tools.mjs";
|
|
9
|
-
import { i as memberIdOf } from "../../_chunks/principal-
|
|
9
|
+
import { i as memberIdOf } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
10
10
|
import { member } from "./actor.mjs";
|
|
11
11
|
import { redactDiagnostic } from "./diagnostics.mjs";
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
@@ -10,7 +10,7 @@ import { groupRoutingHealth } from "../group-routing/health.mjs";
|
|
|
10
10
|
import { dispatchStructuredMessage, structuredMessage } from "./structured.mjs";
|
|
11
11
|
import { handleWorkspaceCallback, isWorkspaceCallback } from "./callbacks.mjs";
|
|
12
12
|
import { telegramText, withTelegramTexts } from "./texts.mjs";
|
|
13
|
-
import { t as agentBuild } from "../../../_chunks/build-metadata-
|
|
13
|
+
import { t as agentBuild } from "../../../_chunks/build-metadata-BMjP89Jo.mjs";
|
|
14
14
|
import { attachmentLifecycle } from "./lifecycle.mjs";
|
|
15
15
|
import { manifestOf } from "../../config.mjs";
|
|
16
16
|
import { gatewayAttachmentDescriber } from "./attachment-description.mjs";
|
|
@@ -26,8 +26,8 @@ import { runtimeToken } from "../runtime-token.mjs";
|
|
|
26
26
|
import { botIdentityCache } from "./bot.mjs";
|
|
27
27
|
import { handleConfirmationCallback, telegramConfirmationEvents } from "./confirmations.mjs";
|
|
28
28
|
import { confirmationLocale } from "./confirmation-text.mjs";
|
|
29
|
-
import { d as failureText, h as withDeliveryLocale, i as withReplacedText, m as safeTelegramFetch, n as currentInboundRequest, o as currentLocale, p as reportTelegramError, r as runInboundRequest, t as InboundRequest } from "../../../_chunks/inbound-request-
|
|
30
|
-
import { n as conversationLanguage, o as telegramPrincipal } from "../../../_chunks/principal-
|
|
29
|
+
import { d as failureText, h as withDeliveryLocale, i as withReplacedText, m as safeTelegramFetch, n as currentInboundRequest, o as currentLocale, p as reportTelegramError, r as runInboundRequest, t as InboundRequest } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
30
|
+
import { n as conversationLanguage, o as telegramPrincipal } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
31
31
|
import { gatewayImageDescriber } from "./images.mjs";
|
|
32
32
|
import { gatewayMediaCapabilities, planMedia } from "./media-policy.mjs";
|
|
33
33
|
import { agentChats } from "./chats.mjs";
|
|
@@ -43,7 +43,7 @@ import { telegramFailureEvents } from "./turn-errors.mjs";
|
|
|
43
43
|
import { withDeliveryDiagnostics } from "./delivery-diagnostics.mjs";
|
|
44
44
|
import { downloadTelegramFile, gatewayTranscriber } from "./voice.mjs";
|
|
45
45
|
import { telegramWebhookVerifier } from "./webhook.mjs";
|
|
46
|
-
import { telegramPreviewEnvironment } from "@segmentstream
|
|
46
|
+
import { telegramPreviewEnvironment } from "@segmentstream/ontology/telegram";
|
|
47
47
|
import { telegramChannel } from "eve/channels/telegram";
|
|
48
48
|
const LEGACY_DEFERRED_CALLBACK = "ss-confirm:d:";
|
|
49
49
|
async function typing(_event, ctx) {
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { describableImage } from "./images.mjs";
|
|
8
|
-
import { p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
8
|
+
import { p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
9
9
|
import { gateway, generateText } from "ai";
|
|
10
10
|
const MAXIMUM_ROUTING_ATTACHMENT_BYTES = 5242880;
|
|
11
11
|
const ROUTING_ATTACHMENT_TIMEOUT_MS = 15e3;
|
|
@@ -12,10 +12,10 @@ import { fetchFileGrant, transientFileStatus } from "../file-grant.mjs";
|
|
|
12
12
|
import { appOrigin, channelsEnabled, proxyEnvironment } from "../environment.mjs";
|
|
13
13
|
import { ACT_AS_HEADER } from "../actor.mjs";
|
|
14
14
|
import { runtimeToken } from "../runtime-token.mjs";
|
|
15
|
-
import "../../../_chunks/principal-
|
|
15
|
+
import "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
16
16
|
import { confirmationLocale } from "./confirmation-text.mjs";
|
|
17
17
|
import { inTelegramSendQueue, telegramSendScope } from "./send-queue.mjs";
|
|
18
|
-
import { d as failureText, f as formattingRefused, l as customerMessage, p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
18
|
+
import { d as failureText, f as formattingRefused, l as customerMessage, p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
19
19
|
import { TELEGRAM_PLACEHOLDER_TOKEN, TELEGRAM_PROXY_ORIGIN, telegramProxyFetch } from "./proxy-fetch.mjs";
|
|
20
20
|
const MAXIMUM_PHOTO_BYTES = 10485760;
|
|
21
21
|
const MAXIMUM_DOCUMENT_BYTES = 52428800;
|
|
@@ -5,8 +5,8 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { object } from "../confirmation-description.mjs";
|
|
8
|
-
import { d as telegramRuntimeSource, i as memberIdOf, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-
|
|
9
|
-
import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
8
|
+
import { d as telegramRuntimeSource, i as memberIdOf, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
9
|
+
import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
10
10
|
import { formatAddress, parseAddress, scopedAddress } from "./sessions.mjs";
|
|
11
11
|
import { telegramText } from "./texts.mjs";
|
|
12
12
|
import { workspaceAction } from "./workspace-action.mjs";
|
|
@@ -7,7 +7,7 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { telegramText } from "./texts.mjs";
|
|
8
8
|
import { renderConfirmation } from "./confirmation-text.mjs";
|
|
9
9
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
10
|
-
import { telegramMarkdownLinks, telegramTextLinks } from "@segmentstream
|
|
10
|
+
import { telegramMarkdownLinks, telegramTextLinks } from "@segmentstream/ontology/telegram";
|
|
11
11
|
import { escapeMarkdownV2 } from "@chat-adapter/telegram";
|
|
12
12
|
const RECEIPT_DATA_SPACE = 512;
|
|
13
13
|
const exactText = new AsyncLocalStorage();
|
|
@@ -12,13 +12,13 @@ import { chatPostOperationId, isChatPost } from "../chat-post-confirmation.mjs";
|
|
|
12
12
|
import { conversationEvent } from "../conversations.mjs";
|
|
13
13
|
import { chatPostCard, chatPostCardStatus, chatPostReceipt, withChatPostCard } from "./chat-post-card.mjs";
|
|
14
14
|
import { answerMarker, isPendingQuestion, pendingQuestions, questionKey } from "../questions.mjs";
|
|
15
|
-
import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
15
|
+
import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
16
16
|
import { confirmationStatus, renderConfirmation, withConfirmationText } from "./confirmation-text.mjs";
|
|
17
|
-
import { i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-
|
|
17
|
+
import { i as memberIdOf, o as telegramPrincipal } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
18
18
|
import { formatAddress, scopedAddress } from "./sessions.mjs";
|
|
19
19
|
import { call } from "eve/events";
|
|
20
20
|
import { createHash } from "node:crypto";
|
|
21
|
-
import { telegramTextLinks } from "@segmentstream
|
|
21
|
+
import { telegramTextLinks } from "@segmentstream/ontology/telegram";
|
|
22
22
|
const PREFIX = "ss-confirm:";
|
|
23
23
|
const recoveredContinuation = (address) => address !== void 0 && /:recovery:[a-f0-9]{64}$/u.test(address);
|
|
24
24
|
function aliasesPendingTopic(scope, token) {
|
|
@@ -9,7 +9,7 @@ import { n as contentText, t as CONTENT_CAPS } from "../../../_chunks/content-cD
|
|
|
9
9
|
import { conversationEvent, sessionFailureEventId } from "../conversations.mjs";
|
|
10
10
|
import { currentConfirmationPrompt } from "../group-routing/messages.mjs";
|
|
11
11
|
import { messageMetadata } from "./message-metadata.mjs";
|
|
12
|
-
import { n as currentInboundRequest, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-
|
|
12
|
+
import { n as currentInboundRequest, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
13
13
|
import { reportMembership } from "./membership.mjs";
|
|
14
14
|
import { currentDeliveryScope } from "./delivery-diagnostics.mjs";
|
|
15
15
|
import { contentShape, messageContent } from "./content.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TelegramPreviewContext } from "@segmentstream
|
|
1
|
+
import { type TelegramPreviewContext } from "@segmentstream/ontology/telegram";
|
|
2
2
|
import { type TelegramText } from "./format.js";
|
|
3
3
|
export { isTechnicalText } from "../customer-text-safety.js";
|
|
4
4
|
export declare function withDeliveryLocale<T>(locale: string, run: () => T, threadId?: string, replyTo?: string, chatId?: string): T;
|
|
@@ -5,5 +5,5 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { isTechnicalText } from "../customer-text-safety.mjs";
|
|
8
|
-
import { a as TelegramDeliveryError, c as customerCopy, d as failureText, f as formattingRefused, h as withDeliveryLocale, l as customerMessage, m as safeTelegramFetch, o as currentLocale, p as reportTelegramError, s as currentThreadId, u as customerText } from "../../../_chunks/inbound-request-
|
|
8
|
+
import { a as TelegramDeliveryError, c as customerCopy, d as failureText, f as formattingRefused, h as withDeliveryLocale, l as customerMessage, m as safeTelegramFetch, o as currentLocale, p as reportTelegramError, s as currentThreadId, u as customerText } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
9
9
|
export { TelegramDeliveryError, currentLocale, currentThreadId, customerCopy, customerMessage, customerText, failureText, formattingRefused, isTechnicalText, reportTelegramError, safeTelegramFetch, withDeliveryLocale };
|
|
@@ -5,8 +5,8 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { MAXIMUM_ATTACHMENT_BYTES, attachmentUrl } from "../attachments.mjs";
|
|
8
|
-
import { d as failureText, p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
9
|
-
import { n as conversationLanguage } from "../../../_chunks/principal-
|
|
8
|
+
import { d as failureText, p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
9
|
+
import { n as conversationLanguage } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
10
10
|
import { describableImage, describeReceivedImage } from "./images.mjs";
|
|
11
11
|
function telegramConversation(chatId) {
|
|
12
12
|
return `telegram:${chatId}`;
|
|
@@ -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 agentBuild } from "../../../_chunks/build-metadata-
|
|
7
|
+
import { t as agentBuild } from "../../../_chunks/build-metadata-BMjP89Jo.mjs";
|
|
8
8
|
import { runtimeRequestFailure } from "./runtime-request.mjs";
|
|
9
9
|
import { GET } from "eve/channels";
|
|
10
10
|
const HEALTH_ROUTE = "/eve/v1/telegram/health";
|
|
@@ -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 { p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
7
|
+
import { p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
8
8
|
import { gateway, generateText } from "ai";
|
|
9
9
|
const MAXIMUM_IMAGE_DESCRIPTION_BYTES = 5242880;
|
|
10
10
|
const MAXIMUM_NATIVE_IMAGE_BYTES = 3145728;
|
|
@@ -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 InboundRequest, n as currentInboundRequest, r as runInboundRequest, i as withReplacedText } from "../../../_chunks/inbound-request-
|
|
7
|
+
export { t as InboundRequest, n as currentInboundRequest, r as runInboundRequest, i as withReplacedText } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
@@ -6,7 +6,7 @@ __eveDirname(__filename);
|
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { WorkspaceActionAlreadyDispatched } from "./workspace-action.mjs";
|
|
8
8
|
import { structuredMessage } from "./structured.mjs";
|
|
9
|
-
import { d as telegramRuntimeSource, n as conversationLanguage, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-
|
|
9
|
+
import { d as telegramRuntimeSource, n as conversationLanguage, o as telegramPrincipal, u as runtimeEnvelope } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
10
10
|
import { routingBurst } from "../group-routing/burst.mjs";
|
|
11
11
|
import { telegramSignals } from "./signals.mjs";
|
|
12
12
|
import { addressingReason, conversationKey, otherRecipient } from "../group-routing/signals.mjs";
|
|
@@ -30,7 +30,7 @@ import { MAXIMUM_ROUTING_ATTACHMENT_BYTES, describeRoutingAttachment, routingAtt
|
|
|
30
30
|
import { recordGateDecision, recordInboundContent, recordRouteDecision } from "./conversations.mjs";
|
|
31
31
|
import { contentShape, messageContent } from "./content.mjs";
|
|
32
32
|
import { messageAudience } from "./audience.mjs";
|
|
33
|
-
import { p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
33
|
+
import { p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
34
34
|
const MAXIMUM_QUOTE_LENGTH = 500;
|
|
35
35
|
function buttonTo(text, url) {
|
|
36
36
|
return { inline_keyboard: [[{
|
|
@@ -4,9 +4,9 @@ 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 { d as telegramRuntimeSource, l as principalRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-
|
|
8
|
-
import { t as agentBuild } from "../../../_chunks/build-metadata-
|
|
9
|
-
import { n as currentInboundRequest } from "../../../_chunks/inbound-request-
|
|
7
|
+
import { d as telegramRuntimeSource, l as principalRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
8
|
+
import { t as agentBuild } from "../../../_chunks/build-metadata-BMjP89Jo.mjs";
|
|
9
|
+
import { n as currentInboundRequest } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
10
10
|
import { object } from "../confirmation-description.mjs";
|
|
11
11
|
import { needsConfirmation } from "../confirmations.mjs";
|
|
12
12
|
import { OntologyActionNotPermitted, actionToolName, ontologyTools } from "../ontology-tools.mjs";
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { DEFAULT_IMAGE_DESCRIPTION_MODEL } from "../../config.mjs";
|
|
8
|
-
import { p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
8
|
+
import { p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
9
9
|
function planMedia(capabilities, descriptionModel = null) {
|
|
10
10
|
if (typeof descriptionModel === "string") return {
|
|
11
11
|
images: "describe",
|
|
@@ -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 TELEGRAM_AUTHENTICATOR, n as conversationLanguage, r as identityProviderOf, i as memberIdOf, a as rolesOf, o as telegramPrincipal } from "../../../_chunks/principal-
|
|
7
|
+
export { t as TELEGRAM_AUTHENTICATOR, n as conversationLanguage, r as identityProviderOf, i as memberIdOf, a as rolesOf, o as telegramPrincipal } from "../../../_chunks/principal-UlkbLrgQ.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 { p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
7
|
+
import { p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
8
8
|
import { createHash } from "node:crypto";
|
|
9
9
|
function strandedRun(error) {
|
|
10
10
|
if (!(error instanceof Error) || error.name !== "RunKeyFetchError" || !("status" in error) || error.status !== 404) return;
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { confirmationLocale } from "./confirmation-text.mjs";
|
|
8
|
-
import { a as TelegramDeliveryError, l as customerMessage, o as currentLocale, p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
8
|
+
import { a as TelegramDeliveryError, l as customerMessage, o as currentLocale, p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
9
9
|
import { splitTelegramText } from "./format.mjs";
|
|
10
10
|
import { inTelegramSendQueue } from "./send-queue.mjs";
|
|
11
11
|
const NO_REPLY_TOOL = "no_reply";
|
|
@@ -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 { d as telegramRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-
|
|
7
|
+
import { d as telegramRuntimeSource, u as runtimeEnvelope } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
8
8
|
import { workspaceAction } from "./workspace-action.mjs";
|
|
9
9
|
import { STRUCTURED_KINDS } from "./structured-settings.mjs";
|
|
10
10
|
const record = (value) => {
|
|
@@ -7,8 +7,8 @@ __eveCreateRequire(import.meta.url);
|
|
|
7
7
|
import { telegramText } from "./texts.mjs";
|
|
8
8
|
import { confirmationLocale } from "./confirmation-text.mjs";
|
|
9
9
|
import { recordSessionFailure } from "./conversations.mjs";
|
|
10
|
-
import { c as customerCopy, d as failureText, o as currentLocale, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-
|
|
11
|
-
import { i as memberIdOf } from "../../../_chunks/principal-
|
|
10
|
+
import { c as customerCopy, d as failureText, o as currentLocale, p as reportTelegramError, s as currentThreadId } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
11
|
+
import { i as memberIdOf } from "../../../_chunks/principal-UlkbLrgQ.mjs";
|
|
12
12
|
import { modelServiceFailure } from "../model-service-failure.mjs";
|
|
13
13
|
function telegramFailureEvents(input) {
|
|
14
14
|
return {
|
|
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
|
|
|
5
5
|
__eveDirname(__filename);
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import "../connection-proxy.mjs";
|
|
8
|
-
import { p as reportTelegramError } from "../../../_chunks/inbound-request-
|
|
8
|
+
import { p as reportTelegramError } from "../../../_chunks/inbound-request-DgQB4g1J.mjs";
|
|
9
9
|
import { gateway, transcribe } from "ai";
|
|
10
10
|
const LABELS = {
|
|
11
11
|
voice: "voice message",
|
package/dist/extension/model.mjs
CHANGED
|
@@ -6,7 +6,7 @@ __eveDirname(__filename);
|
|
|
6
6
|
__eveCreateRequire(import.meta.url);
|
|
7
7
|
import { chatModelChoiceOf } from "./config.mjs";
|
|
8
8
|
import { isPreview } from "./lib/environment.mjs";
|
|
9
|
-
import { a as rolesOf } from "../_chunks/principal-
|
|
9
|
+
import { a as rolesOf } from "../_chunks/principal-UlkbLrgQ.mjs";
|
|
10
10
|
import { runs } from "eve/events";
|
|
11
11
|
import { defineDynamic } from "eve";
|
|
12
12
|
function chooseModel(input) {
|
|
@@ -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 { u as runtimeEnvelope } from "../../_chunks/principal-
|
|
7
|
+
import { u as runtimeEnvelope } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
8
8
|
import segmentstream from "../extension.mjs";
|
|
9
9
|
import { n as workflowToolResult } from "../../_chunks/workflow-serializable-DU7WeCIW.mjs";
|
|
10
10
|
import { actionApproval } from "../lib/confirmations.mjs";
|
|
@@ -8,7 +8,7 @@ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-DU7
|
|
|
8
8
|
import { agentTaskIdOf, agentTaskSessions } from "../lib/agent-task.mjs";
|
|
9
9
|
import { stringArgument } from "../lib/attachment-tools.mjs";
|
|
10
10
|
import { pendingQuestions, questionKey } from "../lib/questions.mjs";
|
|
11
|
-
import { i as memberIdOf } from "../../_chunks/principal-
|
|
11
|
+
import { i as memberIdOf } from "../../_chunks/principal-UlkbLrgQ.mjs";
|
|
12
12
|
import { defineTool } from "eve/tools";
|
|
13
13
|
var questions_ask_default = defineTool({
|
|
14
14
|
availableInSubagents: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segmentstream/agent",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.1",
|
|
4
4
|
"description": "Mount a SegmentStream workspace's agent on eve: the ontology as tools, acting as the member who writes, and Telegram through the workspace's connection.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "SegmentStream",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@chat-adapter/state-memory": "4.42.0",
|
|
77
77
|
"@chat-adapter/telegram": "4.41.0",
|
|
78
78
|
"@chat-adapter/whatsapp": "4.42.0",
|
|
79
|
-
"@segmentstream
|
|
79
|
+
"@segmentstream/ontology": "0.92.0",
|
|
80
80
|
"@vercel/oidc": "^3.8.4",
|
|
81
81
|
"ai": "^7.0.137",
|
|
82
82
|
"chat": "4.42.0",
|