@segmentstream/agent 0.8.2 → 0.8.3

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.
@@ -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.8.2";
7
+ var version = "0.8.3";
8
8
  function agentBuild(environment = process.env) {
9
9
  return {
10
10
  agent: version,
@@ -4,5 +4,5 @@ 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-DMTUHsRx.mjs";
7
+ import { t as agentBuild } from "../../_chunks/build-metadata-BLyaHLJW.mjs";
8
8
  export { agentBuild };
@@ -8,7 +8,7 @@ import { manifestOf } from "../../config.mjs";
8
8
  import { appOrigin, channelsEnabled, proxyEnvironment, runtimeIdentityEnvironment, webhookSecret } from "../environment.mjs";
9
9
  import { conversationLanguage, telegramPrincipal } from "./principal.mjs";
10
10
  import { chooseModel } from "../../model.mjs";
11
- import { t as agentBuild } from "../../../_chunks/build-metadata-DMTUHsRx.mjs";
11
+ import { t as agentBuild } from "../../../_chunks/build-metadata-BLyaHLJW.mjs";
12
12
  import { confirmationLocale } from "./confirmation-text.mjs";
13
13
  import { telegramSendScope } from "./send-queue.mjs";
14
14
  import { d as failureText, h as withDeliveryLocale, i as withReplacedText, m as safeTelegramFetch, n as currentInboundRequest, p as reportTelegramError, r as runInboundRequest, t as InboundRequest } from "../../../_chunks/inbound-request-CYSoY6pu.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 agentBuild } from "../../../_chunks/build-metadata-DMTUHsRx.mjs";
7
+ import { t as agentBuild } from "../../../_chunks/build-metadata-BLyaHLJW.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";
@@ -440,7 +440,7 @@ async function handleInboundMessage(input) {
440
440
  const owner = questionSession ?? await operations?.resolveSession(address) ?? await operations?.resolveSession(topicAddress);
441
441
  const questionHistory = owner === void 0 || dependencies.history === void 0 ? [] : await dependencies.history(owner.id);
442
442
  const pending = questionFromHistory(questionHistory, questionOwner);
443
- let answering = pending !== void 0 && pending.memberId === member.id && pending.chatId === sent.chat.id && pending.messageThreadId === String(sent.messageThreadId ?? "");
443
+ let answering = pending !== void 0 && (input.request?.lifecycleKey === void 0 || pending.taskId === input.request.lifecycleKey) && pending.memberId === member.id && pending.chatId === sent.chat.id && pending.messageThreadId === String(sent.messageThreadId ?? "");
444
444
  const asked = questionHistory.findLast((event) => {
445
445
  const data = isRecord(event.data) ? event.data : {};
446
446
  const result = isRecord(data.result) ? data.result : {};
@@ -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-DMTUHsRx.mjs";
7
+ import { t as agentBuild } from "../../../_chunks/build-metadata-BLyaHLJW.mjs";
8
8
  import { object } from "../confirmation-description.mjs";
9
9
  import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-CYSoY6pu.mjs";
10
10
  import { needsConfirmation } from "../confirmations.mjs";
@@ -138,9 +138,9 @@ function startTypingHeartbeat(telegram) {
138
138
  at: new Date().toISOString(),
139
139
  chatId: telegram.chatId,
140
140
  status: response.status,
141
- accepted: response.ok && object(response.body).ok !== false
141
+ accepted: response.ok && object(response.body).ok === true
142
142
  });
143
- if (!response.ok || object(response.body).ok === false) throw new Error("Telegram rejected sendChatAction.", { cause: {
143
+ if (!response.ok || object(response.body).ok !== true) throw new Error("Telegram rejected sendChatAction.", { cause: {
144
144
  status: response.status,
145
145
  body: response.body
146
146
  } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/agent",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
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",