@segmentstream/agent 0.22.7 → 0.22.8

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.22.7";
7
+ var version = "0.22.8";
8
8
  function agentBuild(environment = process.env) {
9
9
  return {
10
10
  agent: version,
@@ -350,7 +350,7 @@ function sessionSettings(value, issues) {
350
350
  idleResetHours: typeof idleResetHours === "number" && Number.isFinite(idleResetHours) && idleResetHours > 0 ? idleResetHours : false
351
351
  };
352
352
  }
353
- function localizedText(value, path, issues, maximum = 4e3, safe = true) {
353
+ function localizedText(value, path, issues, maximum = 4e3, safe = true, chatPreview = false) {
354
354
  if (!isRecord(value) || Object.keys(value).length === 0) {
355
355
  issues.push({
356
356
  message: "must be a non-empty locale-to-text object",
@@ -367,7 +367,8 @@ function localizedText(value, path, issues, maximum = 4e3, safe = true) {
367
367
  path: [...path, locale]
368
368
  });
369
369
  }
370
- if (typeof text !== "string" || text.trim() === "" || text.length > maximum || safe && typeof text === "string" && isTechnicalText(text)) issues.push({
370
+ const safetyText = chatPreview && typeof text === "string" ? text.replace(/\{(?:recipient|signature|provider)\}/gu, "preview") : text;
371
+ if (typeof text !== "string" || text.trim() === "" || text.length > maximum || safe && typeof safetyText === "string" && isTechnicalText(safetyText)) issues.push({
371
372
  message: `must be ${safe ? "safe " : ""}non-empty text of at most ${maximum} characters`,
372
373
  path: [...path, locale]
373
374
  });
@@ -470,7 +471,7 @@ function telegramTexts(value, issues) {
470
471
  "texts",
471
472
  group,
472
473
  key
473
- ], issues, maximum);
474
+ ], issues, maximum, true, group === "chatPost" && (key === "previewPrivate" || key === "previewGroup"));
474
475
  }
475
476
  }
476
477
  const confirmation = output.confirmation;
@@ -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-Dw_9d3ee.mjs";
7
+ import { t as agentBuild } from "../../_chunks/build-metadata-ChJWiOYx.mjs";
8
8
  export { agentBuild };
@@ -24,7 +24,7 @@ import { MAXIMUM_DOWNLOAD_BYTES, connectionProxy } from "../connection-proxy.mjs
24
24
  import { dispatchStructuredMessage, structuredMessage } from "./structured.mjs";
25
25
  import { scopedAddress, sessionPolicy } from "./sessions.mjs";
26
26
  import { handleWorkspaceCallback, isWorkspaceCallback } from "./callbacks.mjs";
27
- import { t as agentBuild } from "../../../_chunks/build-metadata-Dw_9d3ee.mjs";
27
+ import { t as agentBuild } from "../../../_chunks/build-metadata-ChJWiOYx.mjs";
28
28
  import { attachmentLifecycle } from "./lifecycle.mjs";
29
29
  import { observedMessages } from "./observed.mjs";
30
30
  import { expireDeferredCards, handleDeferredCallback, isDeferredCallback } from "./deferred-confirmations.mjs";
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { runtimeRequestFailure } from "./runtime-request.mjs";
8
- import { t as agentBuild } from "../../../_chunks/build-metadata-Dw_9d3ee.mjs";
8
+ import { t as agentBuild } from "../../../_chunks/build-metadata-ChJWiOYx.mjs";
9
9
  import { GET } from "eve/channels";
10
10
  const HEALTH_ROUTE = "/eve/v1/telegram/health";
11
11
  function healthRoute(input) {
@@ -10,7 +10,7 @@ import { n as currentInboundRequest, p as reportTelegramError } from "../../../_
10
10
  import { member } from "../actor.mjs";
11
11
  import { needsConfirmation } from "../confirmations.mjs";
12
12
  import { OntologyActionNotPermitted, actionToolName, ontologyTools } from "../ontology-tools.mjs";
13
- import { t as agentBuild } from "../../../_chunks/build-metadata-Dw_9d3ee.mjs";
13
+ import { t as agentBuild } from "../../../_chunks/build-metadata-ChJWiOYx.mjs";
14
14
  var AttachmentLifecycleNotPermitted = class extends Error {
15
15
  code = "attachment_lifecycle_not_permitted";
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/agent",
3
- "version": "0.22.7",
3
+ "version": "0.22.8",
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",