@segmentstream/agent 0.48.0 → 0.50.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.
Files changed (91) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/dist/_chunks/{build-metadata-DjhDPTy-.mjs → build-metadata-CLYC7FWE.mjs} +1 -1
  3. package/dist/_chunks/principal-D5Tualrk.mjs +1836 -0
  4. package/dist/extension/channels/slack.mjs +2 -1
  5. package/dist/extension/channels/whatsapp.mjs +1 -0
  6. package/dist/extension/connections/ontology.mjs +1 -1
  7. package/dist/extension/hooks/authorization.mjs +1 -1
  8. package/dist/extension/instructions/persona.mjs +1 -1
  9. package/dist/extension/lib/actor.mjs +1 -46
  10. package/dist/extension/lib/attachment-tools.mjs +1 -3
  11. package/dist/extension/lib/attachments.d.ts +1 -1
  12. package/dist/extension/lib/attachments.mjs +1 -230
  13. package/dist/extension/lib/build-metadata.mjs +1 -1
  14. package/dist/extension/lib/chat-address.mjs +1 -50
  15. package/dist/extension/lib/chat-context.mjs +1 -1
  16. package/dist/extension/lib/chat-recorder.mjs +1 -2
  17. package/dist/extension/lib/confirmations.mjs +1 -179
  18. package/dist/extension/lib/inbound-media/files.d.ts +91 -0
  19. package/dist/extension/lib/inbound-media/files.mjs +7 -0
  20. package/dist/extension/lib/{telegram → inbound-media}/images.d.ts +2 -0
  21. package/dist/extension/lib/{telegram → inbound-media}/images.mjs +1 -2
  22. package/dist/extension/lib/inbound-media/index.d.ts +55 -0
  23. package/dist/extension/lib/inbound-media/index.mjs +7 -0
  24. package/dist/extension/lib/inbound-media/plan.d.ts +59 -0
  25. package/dist/extension/lib/{telegram/media-policy.mjs → inbound-media/plan.mjs} +56 -4
  26. package/dist/extension/lib/inbound-media/report.d.ts +5 -0
  27. package/dist/extension/lib/inbound-media/report.mjs +7 -0
  28. package/dist/extension/lib/inbound-media/speech.d.ts +52 -0
  29. package/dist/extension/lib/inbound-media/speech.mjs +73 -0
  30. package/dist/extension/lib/ontology-connection.mjs +1 -101
  31. package/dist/extension/lib/ontology-file-call.mjs +1 -4
  32. package/dist/extension/lib/ontology-tools.mjs +1 -377
  33. package/dist/extension/lib/review/hold.mjs +1 -2
  34. package/dist/extension/lib/review/reply.mjs +1 -2
  35. package/dist/extension/lib/role-skill.mjs +1 -1
  36. package/dist/extension/lib/runtime-envelope.mjs +1 -1
  37. package/dist/extension/lib/sent-files.mjs +1 -2
  38. package/dist/extension/lib/slack/adapter.d.ts +49 -7
  39. package/dist/extension/lib/slack/adapter.mjs +79 -21
  40. package/dist/extension/lib/slack/attachments-send.mjs +1 -3
  41. package/dist/extension/lib/slack/files.d.ts +12 -19
  42. package/dist/extension/lib/slack/files.mjs +26 -58
  43. package/dist/extension/lib/stored-files.mjs +1 -3
  44. package/dist/extension/lib/telegram/adapter.d.ts +3 -3
  45. package/dist/extension/lib/telegram/adapter.mjs +13 -17
  46. package/dist/extension/lib/telegram/attachment-description.d.ts +1 -1
  47. package/dist/extension/lib/telegram/attachment-description.mjs +2 -2
  48. package/dist/extension/lib/telegram/attachments-send.mjs +1 -3
  49. package/dist/extension/lib/telegram/callbacks.mjs +1 -2
  50. package/dist/extension/lib/telegram/chat-archive.mjs +1 -1
  51. package/dist/extension/lib/telegram/confirmations.mjs +1 -3
  52. package/dist/extension/lib/telegram/customer-text.mjs +1 -1
  53. package/dist/extension/lib/telegram/files.d.ts +8 -15
  54. package/dist/extension/lib/telegram/files.mjs +32 -107
  55. package/dist/extension/lib/telegram/health.mjs +1 -1
  56. package/dist/extension/lib/telegram/held-approvals.mjs +1 -1
  57. package/dist/extension/lib/telegram/inbound-request.d.ts +6 -12
  58. package/dist/extension/lib/telegram/inbound-request.mjs +1 -1
  59. package/dist/extension/lib/telegram/inbound.d.ts +3 -3
  60. package/dist/extension/lib/telegram/inbound.mjs +11 -11
  61. package/dist/extension/lib/telegram/lifecycle.mjs +2 -6
  62. package/dist/extension/lib/telegram/principal.mjs +1 -1
  63. package/dist/extension/lib/telegram/session-recovery.mjs +1 -1
  64. package/dist/extension/lib/telegram/silent.mjs +1 -1
  65. package/dist/extension/lib/telegram/structured.mjs +1 -1
  66. package/dist/extension/lib/telegram/turn-errors.mjs +1 -2
  67. package/dist/extension/lib/telegram/voice.d.ts +7 -38
  68. package/dist/extension/lib/telegram/voice.mjs +1 -64
  69. package/dist/extension/lib/telegram/workspace-action.mjs +1 -3
  70. package/dist/extension/lib/web/auth.mjs +1 -168
  71. package/dist/extension/lib/web/channel.d.ts +13 -4
  72. package/dist/extension/lib/web/channel.mjs +15 -8
  73. package/dist/extension/lib/whatsapp/adapter.d.ts +37 -1
  74. package/dist/extension/lib/whatsapp/adapter.mjs +118 -21
  75. package/dist/extension/lib/whatsapp/files.d.ts +40 -0
  76. package/dist/extension/lib/whatsapp/files.mjs +70 -0
  77. package/dist/extension/lib/workspace-source.mjs +1 -3
  78. package/dist/extension/model.mjs +1 -1
  79. package/dist/extension/tools/attachments_discard.mjs +1 -1
  80. package/dist/extension/tools/attachments_list.mjs +1 -1
  81. package/dist/extension/tools/attachments_promote.mjs +1 -5
  82. package/dist/extension/tools/attachments_read.mjs +1 -1
  83. package/dist/extension/tools/attachments_send.mjs +1 -2
  84. package/dist/extension/tools/attachments_stage.mjs +1 -1
  85. package/dist/extension/tools/attachments_table.mjs +1 -1
  86. package/dist/extension/tools/questions_ask.mjs +1 -2
  87. package/dist/extension/tools/workspace_source.mjs +1 -1
  88. package/package.json +2 -2
  89. package/dist/_chunks/inbound-request-B3RhCuOw.mjs +0 -413
  90. package/dist/_chunks/principal-Dzs8hUDB.mjs +0 -128
  91. package/dist/extension/lib/telegram/media-policy.d.ts +0 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.50.1
4
+
5
+ Pins @segmentstream/ontology 0.105.0.
6
+
7
+ ## 0.50.0
8
+
9
+ The agent answers a website's visitors. `signUp` takes the channel `web` with `origins`, the
10
+ websites by exact origin: a browser on one of them signs its visitor up at
11
+ `POST /api/ontology/agent/visitors`, which creates a user holding the roles `signUp` gives `web`
12
+ and answers an agent token with a refresh token. The refresh token renews the agent token at the
13
+ ontology's OAuth token endpoint as client `agent-web`, which the service serves for visitors even
14
+ with `mcp: false`. A visitor's `onSignUp` that fails runs again before their next turn, as it does
15
+ on a messenger, and so does that of anyone sign-up created who talks to the agent from the app. Any other origin is refused with
16
+ `origin_not_allowed`; one network address may start 10 visitors an hour, and the workspace's cap on
17
+ new users and the agent's turn limits apply as to everyone `signUp` created. `check` refuses `web`
18
+ without origins, and an origin with a path, a wildcard, or `http` beyond `localhost`.
19
+
20
+ The agent's web channel answers browsers on any origin, since every request carries an agent token
21
+ as its bearer, never a cookie.
22
+
23
+ `useAgent({ app })` in `@segmentstream/app/agent` talks to the agent of the workspace app at `app`
24
+ from another website, as its visitor: it signs them up with their first message and keeps their
25
+ refresh token in the browser, so they stay the same user. `visitorToken(app)` gets the token
26
+ outside React and `forgetVisitorTokens()` starts over as a new visitor.
27
+
28
+ Pins @segmentstream/ontology 0.104.0.
29
+
30
+ ## 0.49.0
31
+
32
+ Voice messages, files and images work the same in Telegram, Slack and WhatsApp.
33
+
34
+ - One inbound media pipeline serves every channel. A voice message, audio file or video note
35
+ (Telegram's, a clip recorded in Slack, a WhatsApp voice note or audio) is transcribed with
36
+ `models.stt` before the session sees it: the transcript is the message's text, after its
37
+ caption, and a note such as `[voice message, 12 s]` says it was spoken. Before, Slack handed
38
+ the model the audio file untranscribed, and WhatsApp only the text `[Audio message]`, so the
39
+ agent answered that it could not hear it. `models.stt: false` turns voice off in every channel.
40
+ - A file a member sends in WhatsApp is stored before the turn, as in Telegram and Slack, as the
41
+ member's 24-hour attachment in `whatsapp:<thread id>` and named in the `<attachments>` block,
42
+ so `attachments_read`, `attachments_table`, `attachments_promote` and `attachments_discard`
43
+ work on it. In Slack and WhatsApp eve still hands the model images and documents, downloading
44
+ them through the connection when the turn starts; a spoken file reaches it only as its
45
+ transcript.
46
+ - In Slack and WhatsApp, as in Telegram, an image the turn's chat model does not read natively
47
+ reaches it as a `models.imageDescription` description. In Slack and Telegram the model is the
48
+ one the thread's session runs on, whoever writes now.
49
+ - A file that cannot be stored reads the same in every channel:
50
+ `not received, it is 50.0 MB, over the 20.0 MB the agent accepts`, or
51
+ `not received, it could not be stored; error reference: …`. Telegram's note used the
52
+ workspace's attachment failure text, and Slack's ended in `(reference …)`.
53
+ - WhatsApp shows the typing indicator while the agent works, on the member's latest message, as
54
+ the turn starts and on each tool call. Before, the turn ran where the WhatsApp adapter had no
55
+ record of the message, and the indicator never showed. A refused indicator never stops the
56
+ turn.
57
+
58
+ Action required: upgrade `@segmentstream/ontology` with this release. An older ontology refuses
59
+ `whatsapp` as an attachment source, and a WhatsApp file then reaches the turn named as not stored.
60
+
61
+ Pins @segmentstream/ontology 0.103.0.
62
+
3
63
  ## 0.48.0
4
64
 
5
65
  The agent's limits for people who signed up now apply to the web. Each message a member sends from
@@ -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.48.0";
7
+ var version = "0.50.1";
8
8
  function agentBuild(environment = process.env) {
9
9
  return {
10
10
  agent: version,