@segmentstream/ontology 0.210.0 → 0.210.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.210.1
4
+
5
+ Private agent turns on HTTP channels with hyphens in their names can now record and read messages under the original channel name.
6
+
3
7
  ## 0.210.0
4
8
 
5
9
  A chat now has one optional `description`. Upgrading the ontology combines its existing `purpose` and `when_to_use` text in that field. The agent uses the description in group routing and conversation context. A workspace can use its own language.
@@ -4,7 +4,6 @@ import { CHAT_DIRECTIONS, CHAT_DISPOSITIONS, CHAT_MESSAGE_AUTHORS, CHAT_MESSAGE_
4
4
  import { schemaIssues } from "../../runtime/validation.js";
5
5
  import { bearerEquals } from "../cron-secret.js";
6
6
  import { RequestId, errorBodyForWire } from "../errors.js";
7
- import { Provider } from "./protocol.js";
8
7
  /**
9
8
  * The runtime's routes of the workspace chat store (docs/agent-chat-storage.md): record a message,
10
9
  * change one, read them. Their refusals are codes, in `error` and `detail` alike.
@@ -12,6 +11,8 @@ import { Provider } from "./protocol.js";
12
11
  const NO_STORE = { "cache-control": "no-store" };
13
12
  const MAX_JSON_BYTES = 64 * 1024;
14
13
  const Text = (maximum) => Schema.String.check(Schema.isMinLength(1), Schema.isMaxLength(maximum));
14
+ // The recorder also keys private HTTP chats by their runtime channel kind, e.g. channel:help-desk.
15
+ const MessageChannel = Schema.String.check(Schema.isPattern(/^(?:channel:)?[a-z][a-z0-9_-]{0,31}$/));
15
16
  const ChatId = Text(256);
16
17
  const BotId = Schema.String.check(Schema.isPattern(/^[1-9]\d{0,19}$/));
17
18
  const TelegramBotId = Schema.optionalKey(BotId);
@@ -34,7 +35,7 @@ const ChatFile = Schema.Struct({
34
35
  /** `POST /api/ontology/agent/chats/messages`: one message, recorded once by its keys. */
35
36
  export const ChatMessageRecordRequest = Schema.Struct({
36
37
  telegramBotId: TelegramBotId,
37
- channel: Provider,
38
+ channel: MessageChannel,
38
39
  chatId: ChatId,
39
40
  threadId: Schema.optionalKey(Schema.String.check(Schema.isMaxLength(256))),
40
41
  chatType: Schema.Literals(CHAT_TYPES),
@@ -62,7 +63,7 @@ export const ChatMessageRecordRequest = Schema.Struct({
62
63
  });
63
64
  const Target = {
64
65
  telegramBotId: TelegramBotId,
65
- channel: Provider,
66
+ channel: MessageChannel,
66
67
  chatId: ChatId,
67
68
  messageId: MessageId,
68
69
  };
@@ -112,7 +113,7 @@ export const ChatMessageChangeRequest = Schema.Union([
112
113
  }),
113
114
  // A send's receipt finds its message by the send's key: it had no provider id before.
114
115
  Schema.Struct({
115
- channel: Provider,
116
+ channel: MessageChannel,
116
117
  chatId: ChatId,
117
118
  change: Schema.Literal("sent"),
118
119
  telegramBotId: TelegramBotId,
@@ -150,7 +151,7 @@ export const ChatMessageChangeRequest = Schema.Union([
150
151
  */
151
152
  export const ChatMessageReadRequest = Schema.Struct({
152
153
  telegramBotId: TelegramBotId,
153
- channel: Provider,
154
+ channel: MessageChannel,
154
155
  chatId: Schema.optionalKey(ChatId),
155
156
  threadId: Schema.optionalKey(Schema.NullOr(Text(256))),
156
157
  after: Schema.optionalKey(Revision),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentstream/ontology",
3
- "version": "0.210.0",
3
+ "version": "0.210.1",
4
4
  "description": "Define a SegmentStream workspace app's ontology: entities, relationships, roles and actions, written with Effect.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "SegmentStream",