@segmentstream/agent 0.103.0 → 0.104.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 +39 -0
- package/README.md +6 -0
- package/dist/_chunks/{build-metadata-BkLo_nGS.mjs → build-metadata-DkPNOrqc.mjs} +1 -1
- package/dist/_chunks/{silent-CWcAjHwt.mjs → silent-DwObe1UV.mjs} +18 -3
- package/dist/extension/lib/adapter-view.d.ts +15 -0
- package/dist/extension/lib/adapter-view.mjs +32 -0
- package/dist/extension/lib/attachments-dispatch.d.ts +8 -0
- package/dist/extension/lib/attachments-dispatch.mjs +17 -10
- package/dist/extension/lib/build-metadata.mjs +1 -1
- package/dist/extension/lib/chat-recorder.d.ts +2 -0
- package/dist/extension/lib/chat-recorder.mjs +65 -20
- package/dist/extension/lib/email/attachments-send.d.ts +2 -0
- package/dist/extension/lib/email/attachments-send.mjs +1 -1
- package/dist/extension/lib/email/channel.mjs +24 -16
- package/dist/extension/lib/reply-part.d.ts +11 -0
- package/dist/extension/lib/reply-part.mjs +17 -0
- package/dist/extension/lib/reply.d.ts +115 -0
- package/dist/extension/lib/reply.mjs +107 -0
- package/dist/extension/lib/review/files.d.ts +3 -2
- package/dist/extension/lib/review/files.mjs +1 -1
- package/dist/extension/lib/review/hold.d.ts +7 -0
- package/dist/extension/lib/review/hold.mjs +3 -3
- package/dist/extension/lib/review/reply.d.ts +24 -0
- package/dist/extension/lib/review/reply.mjs +18 -6
- package/dist/extension/lib/review/revision.mjs +3 -1
- package/dist/extension/lib/slack/adapter.mjs +2 -1
- package/dist/extension/lib/telegram/adapter.mjs +55 -50
- package/dist/extension/lib/telegram/health.mjs +1 -1
- package/dist/extension/lib/telegram/lifecycle.mjs +1 -1
- package/dist/extension/lib/telegram/routing-context.mjs +1 -1
- package/dist/extension/lib/telegram/silent.d.ts +3 -1
- package/dist/extension/lib/telegram/silent.mjs +1 -1
- package/dist/extension/lib/whatsapp/adapter.mjs +2 -1
- package/dist/extension/lib/workspace-channel/channel.d.ts +4 -1
- package/dist/extension/lib/workspace-channel/channel.mjs +14 -5
- package/dist/extension/tools/attachments_send.mjs +1 -1
- package/dist/extension/tools/reply.d.ts +19 -0
- package/dist/extension/tools/reply.mjs +180 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.mjs +2 -1
- package/package.json +4 -3
|
@@ -15,6 +15,7 @@ import { whatsappMedia, whatsappTurnContent } from "./files.mjs";
|
|
|
15
15
|
import { chatSdkButtonAnswer, withButtonDecision } from "../confirmation-buttons.mjs";
|
|
16
16
|
import { personaPrincipal } from "../chat-persona.mjs";
|
|
17
17
|
import { channelAttributes, currentChannel, currentKey, withNamedRoutes, withSessionChannels } from "../channel-scope.mjs";
|
|
18
|
+
import { withToolReplies } from "../reply.mjs";
|
|
18
19
|
import { channelReview, withReviewedReplies } from "../review/reply.mjs";
|
|
19
20
|
import { redactDiagnostic } from "../diagnostics.mjs";
|
|
20
21
|
import { MAXIMUM_DOWNLOAD_BYTES, connectionProxy } from "../connection-proxy.mjs";
|
|
@@ -489,7 +490,7 @@ function segmentstreamWhatsApp(options) {
|
|
|
489
490
|
token,
|
|
490
491
|
...options.fetch === void 0 ? {} : { fetch: options.fetch }
|
|
491
492
|
});
|
|
492
|
-
const channel = reviewed === void 0 ? recorded : withReviewedReplies(recorded, () => reviewed.review);
|
|
493
|
+
const channel = withToolReplies(reviewed === void 0 ? recorded : withReviewedReplies(recorded, () => reviewed.review));
|
|
493
494
|
return {
|
|
494
495
|
...withSessionChannels("whatsapp", channel),
|
|
495
496
|
routes: withNamedRoutes("whatsapp", channel.routes.flatMap((route) => route.transport === "websocket" ? [] : [route]), (name) => options.settings(name) !== null)
|
|
@@ -180,7 +180,10 @@ export interface ChannelReply {
|
|
|
180
180
|
/** The person, by their account on the provider. */
|
|
181
181
|
readonly to: string;
|
|
182
182
|
readonly text: string;
|
|
183
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* The message a chat post answers, when it names one, or the person's message the agent's reply
|
|
185
|
+
* answers, when its `reply` names one: only the first part of a reply sent in parts.
|
|
186
|
+
*/
|
|
184
187
|
readonly replyTo?: string;
|
|
185
188
|
/** With `limits.files`, the files `attachments_send` sends, with the caption as `text`. */
|
|
186
189
|
readonly files?: ReadonlyArray<ChannelReplyFile>;
|
|
@@ -20,9 +20,10 @@ import { gatewayMediaCapabilities, turnMediaPlan } from "../inbound-media/plan.m
|
|
|
20
20
|
import { gatewayImageDescriber } from "../inbound-media/images.mjs";
|
|
21
21
|
import { gatewayTranscriber } from "../inbound-media/speech.mjs";
|
|
22
22
|
import { channelReview } from "../review/reply.mjs";
|
|
23
|
-
import { g as turnFiles, n as completionKind } from "../../../_chunks/silent-
|
|
23
|
+
import { g as turnFiles, n as completionKind } from "../../../_chunks/silent-DwObe1UV.mjs";
|
|
24
24
|
import { boundedDownload } from "../sent-files.mjs";
|
|
25
25
|
import { replyFilesSender } from "../attachments-dispatch.mjs";
|
|
26
|
+
import { turnReply } from "../reply.mjs";
|
|
26
27
|
import { runtimeTokenVerifier } from "../runtime-identity.mjs";
|
|
27
28
|
import { runtimeToken } from "../runtime-token.mjs";
|
|
28
29
|
import { runtimeRequestFailure } from "../telegram/runtime-request.mjs";
|
|
@@ -298,10 +299,12 @@ function workspaceChannelDefinition(options) {
|
|
|
298
299
|
};
|
|
299
300
|
async function deliver(reply) {
|
|
300
301
|
const parts = [];
|
|
302
|
+
const { replyTo, ...rest } = reply;
|
|
301
303
|
for (const [index, text] of splitReply(reply.text, maxLength).entries()) {
|
|
302
304
|
const sent = await options.send({
|
|
303
|
-
...
|
|
305
|
+
...rest,
|
|
304
306
|
text,
|
|
307
|
+
...index === 0 && replyTo !== void 0 ? { replyTo } : {},
|
|
305
308
|
...index === 0 || reply.files === void 0 ? {} : { files: [] }
|
|
306
309
|
}, context());
|
|
307
310
|
if (sent !== void 0 && "refusal" in sent) throw new ChannelSendRefused(sent.refusal);
|
|
@@ -738,7 +741,9 @@ function workspaceChannelDefinition(options) {
|
|
|
738
741
|
const principal = ctx.session.auth.current;
|
|
739
742
|
const chat = chatAddressOf(principal);
|
|
740
743
|
if (outcome !== "completed" || chat?.provider !== "custom" || chat.channel !== name || chat.peer === void 0) return;
|
|
741
|
-
const
|
|
744
|
+
const replied = turnReply(ctx.view, turnId, replyText(ctx.view, turnId));
|
|
745
|
+
const text = replied.text;
|
|
746
|
+
const replyTo = replied.source === "reply" ? replied.replyTo : void 0;
|
|
742
747
|
const reviewing = review()?.review;
|
|
743
748
|
const files = reviewing === void 0 ? void 0 : turnFiles(ctx.view, turnId);
|
|
744
749
|
if (completionKind(text) !== "reply") {
|
|
@@ -756,7 +761,9 @@ function workspaceChannelDefinition(options) {
|
|
|
756
761
|
turnId,
|
|
757
762
|
partId: turnId,
|
|
758
763
|
text,
|
|
759
|
-
...files === void 0 || files.files.length === 0 ? {} : { files }
|
|
764
|
+
...files === void 0 || files.files.length === 0 ? {} : { files },
|
|
765
|
+
...replyTo === void 0 ? {} : { replyTo },
|
|
766
|
+
...replied.source === "final_text" ? { fallback: true } : {}
|
|
760
767
|
};
|
|
761
768
|
const proposed = reviewing !== void 0 && reviewing.proposes(principal) ? await reviewing.propose({
|
|
762
769
|
...reply,
|
|
@@ -773,7 +780,8 @@ function workspaceChannelDefinition(options) {
|
|
|
773
780
|
parts = await deliver({
|
|
774
781
|
chatId: chat.chatId,
|
|
775
782
|
to: chat.peer,
|
|
776
|
-
text
|
|
783
|
+
text,
|
|
784
|
+
...replyTo === void 0 ? {} : { replyTo }
|
|
777
785
|
});
|
|
778
786
|
} catch (cause) {
|
|
779
787
|
report("reply_failed", cause);
|
|
@@ -793,6 +801,7 @@ function workspaceChannelDefinition(options) {
|
|
|
793
801
|
kind: "outbound",
|
|
794
802
|
text: part.text,
|
|
795
803
|
messageId: part.id,
|
|
804
|
+
...index === 0 && replyTo !== void 0 ? { replyToMessageId: replyTo } : {},
|
|
796
805
|
senderId: AGENT_SENDER,
|
|
797
806
|
senderIsBot: true,
|
|
798
807
|
status: "completed"
|
|
@@ -9,7 +9,7 @@ import segmentstream from "../extension.mjs";
|
|
|
9
9
|
import { G as memberTool, It as chatAddressOf } from "../../_chunks/principal-DIQHp6AG.mjs";
|
|
10
10
|
import { sendStoredFiles } from "../lib/attachments-dispatch.mjs";
|
|
11
11
|
import { sendAttachmentsInput } from "../lib/telegram/attachments-send.mjs";
|
|
12
|
-
import { d as attachToReply } from "../../_chunks/silent-
|
|
12
|
+
import { d as attachToReply } from "../../_chunks/silent-DwObe1UV.mjs";
|
|
13
13
|
import { repliesReviewed } from "../lib/review/hold.mjs";
|
|
14
14
|
import { defineTool } from "eve/tools";
|
|
15
15
|
const tool = defineTool({
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** The longest reply, as the store and the email channel keep one. */
|
|
2
|
+
export declare const REPLY_TEXT_LIMIT = 100000;
|
|
3
|
+
/** The longest note for staff. */
|
|
4
|
+
export declare const REPLY_NOTE_LIMIT = 4000;
|
|
5
|
+
/**
|
|
6
|
+
* `segmentstream__reply`: the agent's reply to the person in a channel chat, as a deliberate act
|
|
7
|
+
* with its fields (`docs/agent.md`, "Replying in channel chats"). It ends the turn, without another
|
|
8
|
+
* model call. It sends no text itself: when the turn ends, the chat's channel reads the reply from
|
|
9
|
+
* the call and sends it, holds it for review or proposes it to the ontology, as it did a turn's
|
|
10
|
+
* final text, which a call of it replaces. Its files are attached as `attachments_send` attaches
|
|
11
|
+
* them: with the reply in a reviewed chat, and sent at once in any other. Its `note` is kept on the
|
|
12
|
+
* turn as an internal message for staff, never sent (`lib/chat-recorder.ts`). Offered in every
|
|
13
|
+
* channel chat, a guest's included, and never in the web chat, a workflow's task or a redraft,
|
|
14
|
+
* whose final text is their answer. Exported for the reply evaluation, which offers a model exactly
|
|
15
|
+
* this description and schema.
|
|
16
|
+
*/
|
|
17
|
+
export declare const replyTool: import("eve/tools").ToolDefinition<Record<string, unknown>, import("../lib/workflow-serializable.js").WorkflowSerializable>;
|
|
18
|
+
declare const _default: import("eve").DynamicSentinel<import("eve/tools").DynamicToolResult, import("eve").DynamicContext>;
|
|
19
|
+
export default _default;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { fileURLToPath as __eveFileURLToPath } from "node:url";
|
|
2
|
+
import { dirname as __eveDirname } from "node:path";
|
|
3
|
+
import { createRequire as __eveCreateRequire } from "node:module";
|
|
4
|
+
const __filename = __eveFileURLToPath(import.meta.url);
|
|
5
|
+
__eveDirname(__filename);
|
|
6
|
+
__eveCreateRequire(import.meta.url);
|
|
7
|
+
import segmentstream from "../extension.mjs";
|
|
8
|
+
import { It as chatAddressOf, U as isGuestSession } from "../../_chunks/principal-DIQHp6AG.mjs";
|
|
9
|
+
import { optionalString, stringArgument } from "../lib/attachment-tools.mjs";
|
|
10
|
+
import { sendStoredFiles } from "../lib/attachments-dispatch.mjs";
|
|
11
|
+
import { EMAIL_OTHERS_ATTRIBUTE } from "../lib/email/channel.mjs";
|
|
12
|
+
import { repliesWithTool } from "../lib/reply.mjs";
|
|
13
|
+
import { d as attachToReply } from "../../_chunks/silent-DwObe1UV.mjs";
|
|
14
|
+
import { repliesReviewed } from "../lib/review/hold.mjs";
|
|
15
|
+
import { sendAttachmentsInput } from "../lib/telegram/attachments-send.mjs";
|
|
16
|
+
import { n as workflowToolResult } from "../../_chunks/workflow-serializable-gzv5MZ5P.mjs";
|
|
17
|
+
import { WORKSPACE_CHANNEL_ID } from "@segmentstream/ontology/workspace-channel";
|
|
18
|
+
import { defineDynamic, defineTool } from "eve/tools";
|
|
19
|
+
import { EMAIL_RECIPIENTS_LIMIT, isEmailAddress } from "@segmentstream/ontology/email";
|
|
20
|
+
const REPLY_TEXT_LIMIT = 1e5;
|
|
21
|
+
const REPLY_NOTE_LIMIT = 4e3;
|
|
22
|
+
const TELEGRAM_MESSAGE_ID = /^[1-9]\d*$/u;
|
|
23
|
+
const FILE_REFERENCE = { anyOf: [{
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "A document record id (UUID)."
|
|
26
|
+
}, {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
entity: { type: "string" },
|
|
30
|
+
id: { type: "string" },
|
|
31
|
+
property: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "Required when there are multiple file properties."
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
required: ["entity", "id"],
|
|
37
|
+
additionalProperties: false
|
|
38
|
+
}] };
|
|
39
|
+
function threadPeople(principal) {
|
|
40
|
+
const others = principal?.attributes[EMAIL_OTHERS_ATTRIBUTE];
|
|
41
|
+
const peer = chatAddressOf(principal)?.peer;
|
|
42
|
+
return new Set([...peer === void 0 ? [] : [peer], ...Array.isArray(others) ? others : []].filter((address) => typeof address === "string").map((address) => address.toLowerCase()));
|
|
43
|
+
}
|
|
44
|
+
function addresses(input, name, people) {
|
|
45
|
+
const value = input[name];
|
|
46
|
+
if (value === void 0) return;
|
|
47
|
+
if (!Array.isArray(value) || name === "to" && value.length === 0) throw new TypeError(name === "to" ? "to must list at least one address." : "cc must be a list of addresses.");
|
|
48
|
+
return [...new Set(value.map((item) => {
|
|
49
|
+
const address = typeof item === "string" ? item.trim().toLowerCase() : "";
|
|
50
|
+
if (!isEmailAddress(address)) throw new TypeError(`${name} must list email addresses.`);
|
|
51
|
+
if (!people.has(address)) throw new TypeError(`${address} is not one of this thread's people. A reply goes only to the people of the mail it answers; leave to and cc out to reply as the mailbox does.`);
|
|
52
|
+
return address;
|
|
53
|
+
}))];
|
|
54
|
+
}
|
|
55
|
+
function fileFailures(result) {
|
|
56
|
+
const files = typeof result === "object" && result !== null ? result.files : void 0;
|
|
57
|
+
if (!Array.isArray(files)) return {
|
|
58
|
+
sent: [],
|
|
59
|
+
failed: []
|
|
60
|
+
};
|
|
61
|
+
const sent = [];
|
|
62
|
+
const failed = [];
|
|
63
|
+
for (const file of files) {
|
|
64
|
+
const id = typeof file?.id === "string" ? file.id : "a file";
|
|
65
|
+
if (typeof file?.error === "string") failed.push(`${id} (${file.error}${typeof file.detail === "string" ? `: ${file.detail}` : ""})`);
|
|
66
|
+
else sent.push(id);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
sent,
|
|
70
|
+
failed
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const replyTool = defineTool({
|
|
74
|
+
availableInSubagents: false,
|
|
75
|
+
description: "Send your reply to the person in this chat: the one message they read from you this turn. Call it once, when your answer is complete, with the whole message in text, in the chat's language and formatted as the channel shows it. Use it for every answer in this chat, however short; text you write outside it is not a reply. To answer nothing, call segmentstream__no_reply instead. files sends stored ontology files with the reply. In a reply to mail, to and cc choose, among the thread's people only, whom it goes to and copies; leave them out to reply as the mailbox does. note is for the workspace's staff and never reaches the person: what you checked, assumed or could not confirm, which a member reviewing the reply reads beside it. If the call fails, fix what its error names and call it again.",
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: "object",
|
|
78
|
+
properties: {
|
|
79
|
+
text: {
|
|
80
|
+
type: "string",
|
|
81
|
+
minLength: 1,
|
|
82
|
+
maxLength: REPLY_TEXT_LIMIT,
|
|
83
|
+
description: "The whole message, exactly as the person will read it."
|
|
84
|
+
},
|
|
85
|
+
files: {
|
|
86
|
+
type: "array",
|
|
87
|
+
minItems: 1,
|
|
88
|
+
maxItems: 10,
|
|
89
|
+
items: FILE_REFERENCE,
|
|
90
|
+
description: "Stored ontology files sent with the reply: document record ids, or entity/id/property references."
|
|
91
|
+
},
|
|
92
|
+
to: {
|
|
93
|
+
type: "array",
|
|
94
|
+
minItems: 1,
|
|
95
|
+
items: { type: "string" },
|
|
96
|
+
description: "A reply to mail only: the addresses it goes to, among the thread's people. By default the person who wrote."
|
|
97
|
+
},
|
|
98
|
+
cc: {
|
|
99
|
+
type: "array",
|
|
100
|
+
items: { type: "string" },
|
|
101
|
+
description: "A reply to mail only: the addresses it copies, among the thread's people. By default the mail's other people when the mailbox replies to all, else none."
|
|
102
|
+
},
|
|
103
|
+
replyTo: {
|
|
104
|
+
type: "string",
|
|
105
|
+
description: "The id of the person's message this reply answers, when it is not their latest. Telegram and workspace channels quote it; other channels ignore it."
|
|
106
|
+
},
|
|
107
|
+
note: {
|
|
108
|
+
type: "string",
|
|
109
|
+
maxLength: REPLY_NOTE_LIMIT,
|
|
110
|
+
description: "For the workspace's staff, never sent to the person."
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
required: ["text"],
|
|
114
|
+
additionalProperties: false
|
|
115
|
+
},
|
|
116
|
+
endsTurn: true,
|
|
117
|
+
label: false,
|
|
118
|
+
async execute(input, ctx) {
|
|
119
|
+
const value = input ?? {};
|
|
120
|
+
const principal = ctx.session.auth.current;
|
|
121
|
+
const chat = chatAddressOf(principal);
|
|
122
|
+
if (chat === void 0 || !repliesWithTool(principal)) throw new Error("This session has no channel chat to reply in; answer in text.");
|
|
123
|
+
const text = stringArgument(value, "text");
|
|
124
|
+
const note = optionalString(value, "note");
|
|
125
|
+
if (text.length > 1e5) throw new TypeError(`text is longer than ${REPLY_TEXT_LIMIT} characters.`);
|
|
126
|
+
if (note !== void 0 && note.length > 4e3) throw new TypeError(`note is longer than ${REPLY_NOTE_LIMIT} characters.`);
|
|
127
|
+
if ((value.to !== void 0 || value.cc !== void 0) && chat.provider !== "email") throw new TypeError("to and cc apply only to a reply to mail; leave them out here.");
|
|
128
|
+
const people = threadPeople(principal);
|
|
129
|
+
const to = addresses(value, "to", people);
|
|
130
|
+
const cc = addresses(value, "cc", people)?.filter((address) => !to?.includes(address));
|
|
131
|
+
if ((to?.length ?? 1) + (cc?.length ?? 0) > EMAIL_RECIPIENTS_LIMIT) throw new TypeError(`A reply to mail goes to at most ${EMAIL_RECIPIENTS_LIMIT} people.`);
|
|
132
|
+
const named = optionalString(value, "replyTo");
|
|
133
|
+
const replyTo = chat.provider === "telegram" || chat.provider === "custom" ? named : void 0;
|
|
134
|
+
if (replyTo !== void 0 && !(chat.provider === "telegram" ? TELEGRAM_MESSAGE_ID : WORKSPACE_CHANNEL_ID).test(replyTo)) throw new TypeError("replyTo must be the id of a message in this chat.");
|
|
135
|
+
let files = {};
|
|
136
|
+
if (value.files !== void 0) {
|
|
137
|
+
if (isGuestSession(principal)) throw new Error("Files cannot be sent in a guest's chat; reply without them.");
|
|
138
|
+
const parsed = sendAttachmentsInput({ documentIds: value.files });
|
|
139
|
+
if (repliesReviewed(segmentstream.config.review, principal)) {
|
|
140
|
+
const attached = await attachToReply({
|
|
141
|
+
files: parsed.documentIds,
|
|
142
|
+
principal
|
|
143
|
+
});
|
|
144
|
+
if ("error" in attached) throw new Error(`The files were not attached (${attached.error}): ${attached.detail} Reply without them, or with others.`);
|
|
145
|
+
files = {
|
|
146
|
+
attached: true,
|
|
147
|
+
files: attached.files
|
|
148
|
+
};
|
|
149
|
+
} else {
|
|
150
|
+
const sent = await sendStoredFiles({
|
|
151
|
+
channels: segmentstream.config.channels,
|
|
152
|
+
files: parsed,
|
|
153
|
+
principal,
|
|
154
|
+
sessionId: ctx.session.id,
|
|
155
|
+
turnId: ctx.session.turn.id,
|
|
156
|
+
callId: ctx.callId,
|
|
157
|
+
...to === void 0 && cc === void 0 ? {} : { email: {
|
|
158
|
+
...to === void 0 ? {} : { to },
|
|
159
|
+
...cc === void 0 ? {} : { cc }
|
|
160
|
+
} }
|
|
161
|
+
});
|
|
162
|
+
if (typeof sent === "object" && sent !== null && typeof sent.error === "string") throw new Error(`The files were not sent (${sent.error}). Reply without them, or with others.`);
|
|
163
|
+
const failed = fileFailures(sent);
|
|
164
|
+
if (failed.failed.length > 0) throw new Error(`These files were not sent: ${failed.failed.join("; ")}.` + (failed.sent.length === 0 ? "" : ` These were sent already, so leave them out: ${failed.sent.join(", ")}.`) + " Call reply again with the files that remain, or without them.");
|
|
165
|
+
files = { sent };
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return workflowToolResult({
|
|
169
|
+
replied: true,
|
|
170
|
+
text,
|
|
171
|
+
...to === void 0 ? {} : { to },
|
|
172
|
+
...cc === void 0 ? {} : { cc },
|
|
173
|
+
...replyTo === void 0 ? {} : { replyTo },
|
|
174
|
+
...note === void 0 ? {} : { note },
|
|
175
|
+
...files
|
|
176
|
+
}, ctx);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
var reply_default = defineDynamic((context) => repliesWithTool(context.session.auth.current) ? replyTool : null);
|
|
180
|
+
export { REPLY_NOTE_LIMIT, REPLY_TEXT_LIMIT, reply_default as default, replyTool };
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { default as handoff } from "../extension/tools/handoff.js";
|
|
|
12
12
|
export { default as no_reply } from "../extension/tools/no_reply.js";
|
|
13
13
|
export { default as ontology_call_file } from "../extension/tools/ontology_call_file.js";
|
|
14
14
|
export { default as questions_ask } from "../extension/tools/questions_ask.js";
|
|
15
|
+
export { default as reply } from "../extension/tools/reply.js";
|
|
15
16
|
export { default as sandbox } from "../extension/tools/sandbox.js";
|
|
16
17
|
export { default as unanswered } from "../extension/tools/unanswered.js";
|
|
17
18
|
export { default as web_fetch } from "../extension/tools/web_fetch.js";
|
package/dist/tools/index.mjs
CHANGED
|
@@ -16,9 +16,10 @@ import handoff_default from "../extension/tools/handoff.mjs";
|
|
|
16
16
|
import no_reply_default from "../extension/tools/no_reply.mjs";
|
|
17
17
|
import ontology_call_file_default from "../extension/tools/ontology_call_file.mjs";
|
|
18
18
|
import questions_ask_default from "../extension/tools/questions_ask.mjs";
|
|
19
|
+
import reply_default from "../extension/tools/reply.mjs";
|
|
19
20
|
import sandbox_default from "../extension/tools/sandbox.mjs";
|
|
20
21
|
import unanswered_default from "../extension/tools/unanswered.mjs";
|
|
21
22
|
import web_fetch_default from "../extension/tools/web_fetch.mjs";
|
|
22
23
|
import web_search_default from "../extension/tools/web_search.mjs";
|
|
23
24
|
import workspace_source_default from "../extension/tools/workspace_source.mjs";
|
|
24
|
-
export { attachments_discard_default as attachments_discard, attachments_list_default as attachments_list, attachments_promote_default as attachments_promote, attachments_read_default as attachments_read, attachments_send_default as attachments_send, attachments_stage_default as attachments_stage, attachments_table_default as attachments_table, browser_default as browser, handoff_default as handoff, no_reply_default as no_reply, ontology_call_file_default as ontology_call_file, questions_ask_default as questions_ask, sandbox_default as sandbox, unanswered_default as unanswered, web_fetch_default as web_fetch, web_search_default as web_search, workspace_source_default as workspace_source };
|
|
25
|
+
export { attachments_discard_default as attachments_discard, attachments_list_default as attachments_list, attachments_promote_default as attachments_promote, attachments_read_default as attachments_read, attachments_send_default as attachments_send, attachments_stage_default as attachments_stage, attachments_table_default as attachments_table, browser_default as browser, handoff_default as handoff, no_reply_default as no_reply, ontology_call_file_default as ontology_call_file, questions_ask_default as questions_ask, reply_default as reply, sandbox_default as sandbox, unanswered_default as unanswered, web_fetch_default as web_fetch, web_search_default as web_search, workspace_source_default as workspace_source };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segmentstream/agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.104.0",
|
|
4
4
|
"description": "The SegmentStream workspace agent: the ontology as tools, acting as the member who writes, and the browser, Telegram, WhatsApp and Slack through the workspace's connections.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "SegmentStream",
|
|
@@ -82,13 +82,14 @@
|
|
|
82
82
|
"lint": "eslint src tests --config ../../eslint.config.mjs",
|
|
83
83
|
"test": "vitest run",
|
|
84
84
|
"prepack": "pnpm run build",
|
|
85
|
-
"eval:routing": "tsx tests/routing-eval/cli.ts"
|
|
85
|
+
"eval:routing": "tsx tests/routing-eval/cli.ts",
|
|
86
|
+
"eval:reply": "tsx tests/reply-eval/cli.ts"
|
|
86
87
|
},
|
|
87
88
|
"dependencies": {
|
|
88
89
|
"@chat-adapter/state-memory": "4.42.0",
|
|
89
90
|
"@chat-adapter/telegram": "4.41.0",
|
|
90
91
|
"@chat-adapter/whatsapp": "4.42.0",
|
|
91
|
-
"@segmentstream/ontology": "0.
|
|
92
|
+
"@segmentstream/ontology": "0.183.0",
|
|
92
93
|
"@vercel/oidc": "^3.8.4",
|
|
93
94
|
"ai": "^7.0.172",
|
|
94
95
|
"chat": "4.42.0",
|