@segmentstream/agent 0.17.11 → 0.17.13

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 CHANGED
@@ -309,7 +309,9 @@ share a group chat's session never share a client.
309
309
  applies per-path probability thresholds. Pending questions are hints inside a live conversation,
310
310
  never a bypass or another session. Untagged bursts wait 6 seconds (maximum 15); same-caller
311
311
  messages steer one chat/topic session and other callers are rechecked when dequeued. A durable
312
- burst fence prevents a second accepted turn. See [group configuration](../../docs/agent.md#groups).
312
+ burst fence prevents a second accepted turn. Claimed mentions and commands survive later
313
+ human-directed messages in the burst, recorded as `dequeue_explicit_kept`; archive failures
314
+ and duplicate claims still cancel. See [group configuration](../../docs/agent.md#groups).
313
315
  - **Voice.** Voice messages, audio files and video notes are downloaded through the connection and
314
316
  transcribed with `models.stt` through AI Gateway before the turn.
315
317
  The transcript becomes the message, with a note such as `[voice message, 12 s]` in
@@ -615,7 +617,7 @@ Eve resolution, so member/topic routing survives a cold start. No second provide
615
617
 
616
618
  ## Release and migration
617
619
 
618
- The coordinated release uses Agent SDK 0.17.6, Eve 0.76.3, Ontology SDK 0.54.2 and App SDK 0.25.0.
620
+ The coordinated release uses Agent SDK 0.17.13, Eve 0.76.3, Ontology SDK 0.56.0 and App SDK 0.25.2.
619
621
  The compatible Cloud archive/API must be deployed first; migrations run only through its CI/CD gate.
620
622
  Publish the ontology SDK before the agent SDK. Upgrade the workspace ontology before its agent,
621
623
  with the declared Telegram provider mapping and explicit `agent_chat:post_message` grant.
@@ -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.17.11";
7
+ var version = "0.17.13";
8
8
  function agentBuild(environment = process.env) {
9
9
  return {
10
10
  agent: version,
@@ -88,6 +88,8 @@ const FIELDS = [
88
88
  "remoteErrorId",
89
89
  "endpoint",
90
90
  "requestId",
91
+ "reason",
92
+ "connection",
91
93
  "providerMessage",
92
94
  "providerDescription",
93
95
  "stderr",
@@ -561,11 +563,14 @@ function makeErrorReporter({ configuration, generateId = randomUUID, now = () =>
561
563
  };
562
564
  }
563
565
  function reportRuntimeFailure(error, context, environment = process.env) {
566
+ return captureRuntimeFailure(error, context, environment).errorId;
567
+ }
568
+ function captureRuntimeFailure(error, context, environment = process.env, values = []) {
564
569
  const { service, ...details } = context;
565
570
  return makeErrorReporter({ configuration: {
566
571
  service,
567
- redactedValues: environmentSecrets(environment)
568
- } }).report(error, details);
572
+ redactedValues: [...environmentSecrets(environment), ...values]
573
+ } }).capture(error, details);
569
574
  }
570
575
  const errorStackGetter = Object.getOwnPropertyDescriptor(new Error(), "stack")?.get;
571
576
  function intrinsicGetter(prototype, name) {
@@ -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-BXa6pCE3.mjs";
7
+ import { t as agentBuild } from "../../_chunks/build-metadata-DfGc35Vd.mjs";
8
8
  export { agentBuild };
@@ -6,7 +6,7 @@ __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { proxyEnvironment } from "./environment.mjs";
8
8
  import { runtimeToken } from "./runtime-token.mjs";
9
- import { r as workflowValue } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
9
+ import { r as workflowValue } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
10
10
  function collapseConversationEvents(events) {
11
11
  const latest = new Map();
12
12
  for (const event of events) {
@@ -4,6 +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 { addressingReason } from "./signals.mjs";
7
8
  import { recordedMessageSignals } from "./conversation.mjs";
8
9
  import { conversationDecisionRouter } from "./conversation-router.mjs";
9
10
  import { routeMessage } from "./router.mjs";
@@ -54,7 +55,9 @@ function conversationDequeueGuard(archive = conversations(), classifier = decide
54
55
  const burst = routingBurst(input.signals, recent, input.policy);
55
56
  const latest = burst.messages.at(-1);
56
57
  const signals = recordedMessageSignals(latest, input.signals);
57
- const route = await routeMessage({
58
+ const claimedAddressing = addressingReason(input.signals);
59
+ const explicit = claimedAddressing === "mention" || claimedAddressing === "command";
60
+ const route = explicit ? "reply" : await routeMessage({
58
61
  groups: input.policy,
59
62
  signals,
60
63
  policy: input.policy.mode,
@@ -122,10 +125,11 @@ function conversationDequeueGuard(archive = conversations(), classifier = decide
122
125
  eventId: `group-routing:dequeue:${ctx.session.turn.id}`,
123
126
  kind: "decision",
124
127
  decision: route === "reply" ? "reply" : "silent",
125
- reason: `dequeue_${route}`,
128
+ reason: explicit ? "dequeue_explicit_kept" : `dequeue_${route}`,
126
129
  argsSummary: JSON.stringify({
127
130
  router: decisions.at(-1)?.router,
128
- burst_id: input.burst_id
131
+ burst_id: input.burst_id,
132
+ claimed_addressing: explicit ? claimedAddressing : void 0
129
133
  })
130
134
  }));
131
135
  if (route === "observe") ctx.cancel();
@@ -20,7 +20,7 @@ import { archivedRoutingMessages } from "../group-routing/routing-context.mjs";
20
20
  import { dispatchStructuredMessage, structuredMessage } from "./structured.mjs";
21
21
  import { scopedAddress, sessionPolicy } from "./sessions.mjs";
22
22
  import { handleWorkspaceCallback, isWorkspaceCallback } from "./callbacks.mjs";
23
- import { t as agentBuild } from "../../../_chunks/build-metadata-BXa6pCE3.mjs";
23
+ import { t as agentBuild } from "../../../_chunks/build-metadata-DfGc35Vd.mjs";
24
24
  import { attachmentLifecycle } from "./lifecycle.mjs";
25
25
  import { observedMessages } from "./observed.mjs";
26
26
  import { expireDeferredCards, handleDeferredCallback, isDeferredCallback } from "./deferred-confirmations.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-BXa6pCE3.mjs";
7
+ import { t as agentBuild } from "../../../_chunks/build-metadata-DfGc35Vd.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";
@@ -9,7 +9,7 @@ import { object } from "../confirmation-description.mjs";
9
9
  import { n as currentInboundRequest, p as reportTelegramError } from "../../../_chunks/inbound-request-DxRm5LC8.mjs";
10
10
  import { needsConfirmation } from "../confirmations.mjs";
11
11
  import { OntologyActionNotPermitted, actionToolName, ontologyTools } from "../ontology-tools.mjs";
12
- import { t as agentBuild } from "../../../_chunks/build-metadata-BXa6pCE3.mjs";
12
+ import { t as agentBuild } from "../../../_chunks/build-metadata-DfGc35Vd.mjs";
13
13
  var AttachmentLifecycleNotPermitted = class extends Error {
14
14
  code = "attachment_lifecycle_not_permitted";
15
15
  };
@@ -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 { n as workflowToolResult, r as workflowValue, t as toWorkflowSerializable } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
7
+ import { n as workflowToolResult, r as workflowValue, t as toWorkflowSerializable } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
8
8
  export { toWorkflowSerializable, workflowToolResult, workflowValue };
@@ -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 workflowToolResult } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
7
+ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
8
8
  import { ID_INPUT, attachmentForModel, attachmentOwner, stringArgument, toolAttachments } from "../lib/attachment-tools.mjs";
9
9
  import { defineTool } from "eve/tools";
10
10
  var attachments_discard_default = defineTool({
@@ -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 workflowToolResult } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
7
+ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
8
8
  import { attachmentForModel, attachmentOwner, toolAttachments } from "../lib/attachment-tools.mjs";
9
9
  import { defineTool } from "eve/tools";
10
10
  var attachments_list_default = defineTool({
@@ -5,7 +5,7 @@ const __filename = __eveFileURLToPath(import.meta.url);
5
5
  __eveDirname(__filename);
6
6
  __eveCreateRequire(import.meta.url);
7
7
  import { u as runtimeEnvelope } from "../../_chunks/principal-B6u41vIf.mjs";
8
- import { n as workflowToolResult } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
8
+ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
9
9
  import segmentstream from "../extension.mjs";
10
10
  import { actionApproval } from "../lib/confirmations.mjs";
11
11
  import { ontologyTools, promotionTarget } from "../lib/ontology-tools.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 { n as workflowToolResult } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
7
+ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
8
8
  import { ID_INPUT, attachmentOwner, headerArgument, optionalString, pageInteger, readOutput, stringArgument, toolAttachments } from "../lib/attachment-tools.mjs";
9
9
  import { readStoredFile } from "../lib/stored-files.mjs";
10
10
  import { defineTool } from "eve/tools";
@@ -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 workflowToolResult } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
7
+ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
8
8
  import segmentstream from "../extension.mjs";
9
9
  import { sendAttachments, sendAttachmentsInput } from "../lib/telegram/attachments-send.mjs";
10
10
  import { defineTool } from "eve/tools";
@@ -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 workflowToolResult } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
7
+ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
8
8
  import { readSheets, typedTable } from "../lib/attachment-tables.mjs";
9
9
  import { queryTable } from "../lib/attachment-query.mjs";
10
10
  import { ID_INPUT, attachmentForModel, attachmentOwner, boundedResultPage, headerArgument, optionalString, pageInteger, stringArgument, toolAttachments } from "../lib/attachment-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 { i as memberIdOf } from "../../_chunks/principal-B6u41vIf.mjs";
8
- import { n as workflowToolResult } from "../../_chunks/workflow-serializable-CLscIGYk.mjs";
8
+ import { n as workflowToolResult } from "../../_chunks/workflow-serializable-_g4JRau5.mjs";
9
9
  import { pendingQuestions, questionKey } from "../lib/questions.mjs";
10
10
  import { stringArgument } from "../lib/attachment-tools.mjs";
11
11
  import { defineTool } from "eve/tools";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/agent",
3
- "version": "0.17.11",
3
+ "version": "0.17.13",
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",
@@ -66,7 +66,7 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@chat-adapter/telegram": "4.41.0",
69
- "@segmentstream-cloud/ontology": "0.55.1",
69
+ "@segmentstream-cloud/ontology": "0.56.0",
70
70
  "@vercel/oidc": "^3.8.4",
71
71
  "ai": "^7.0.128",
72
72
  "csv-parse": "^7.0.3",