openmates 0.18.0-alpha.45 → 0.18.0-alpha.46

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.
@@ -3693,6 +3693,7 @@ var OpenMatesWsClient = class {
3693
3693
  }
3694
3694
  };
3695
3695
  const finishPostProcessingWait = () => {
3696
+ postProcessingTimer = null;
3696
3697
  postProcessingDone = true;
3697
3698
  maybeResolve();
3698
3699
  };
@@ -3858,7 +3859,13 @@ var OpenMatesWsClient = class {
3858
3859
  aiResponseDone = true;
3859
3860
  latestContent = content;
3860
3861
  clearTimeout(timeout);
3861
- postProcessingTimer = setTimeout(finishPostProcessingWait, POST_PROCESSING_WINDOW_MS);
3862
+ if (postProcessingDone) {
3863
+ maybeResolve();
3864
+ return;
3865
+ }
3866
+ if (!postProcessingTimer) {
3867
+ postProcessingTimer = setTimeout(finishPostProcessingWait, POST_PROCESSING_WINDOW_MS);
3868
+ }
3862
3869
  };
3863
3870
  const beginSubChatContinuation = (payload) => {
3864
3871
  if (!awaitingSubChatsCompletion) return;
@@ -7287,6 +7294,20 @@ function hasRememberMessageReference(message) {
7287
7294
  var PROMPT_INJECTION_DISABLED = "disabled";
7288
7295
  var DEFAULT_CHAT_MESSAGE_CONFIRMATION_TIMEOUT_MS = 2e4;
7289
7296
  var CANONICAL_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
7297
+ var MAX_CHAT_SLUG_LENGTH = 80;
7298
+ function selectNewChatSlugValue(input) {
7299
+ if (input.explicitSlug !== void 0) return input.explicitSlug;
7300
+ let normalizedMessage;
7301
+ try {
7302
+ normalizedMessage = normalizeObjectSlug(input.message);
7303
+ } catch {
7304
+ normalizedMessage = "chat";
7305
+ }
7306
+ const normalizedChatId = input.chatId.toLowerCase();
7307
+ const prefixLength = MAX_CHAT_SLUG_LENGTH - normalizedChatId.length - 1;
7308
+ const prefix = normalizedMessage.slice(0, prefixLength).replace(/-+$/g, "");
7309
+ return `${prefix}-${normalizedChatId}`;
7310
+ }
7290
7311
  function normalizeObjectSelectorLabel(value) {
7291
7312
  return value.trim().toLowerCase().replace(/\s+/g, " ");
7292
7313
  }
@@ -11316,7 +11337,11 @@ var OpenMatesClient = class _OpenMatesClient {
11316
11337
  }
11317
11338
  const initialTitle = teamId && !shouldWaitForAi ? "New team chat" : "";
11318
11339
  const slugMetadata = await buildEncryptedObjectSlugMetadata({
11319
- value: params.slug ?? finalMessage,
11340
+ value: selectNewChatSlugValue({
11341
+ message: finalMessage,
11342
+ chatId,
11343
+ explicitSlug: params.slug
11344
+ }),
11320
11345
  encryptionKey: chatKeyBytes,
11321
11346
  lookupKey: chatSlugLookupKey
11322
11347
  });
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  serializeToYaml,
14
14
  shouldRequireTrustedAccountGuard,
15
15
  waitForWorkflowRun
16
- } from "./chunk-FUR4UVY6.js";
16
+ } from "./chunk-WQNH4XI6.js";
17
17
  import "./chunk-IWKP55ZB.js";
18
18
  import "./chunk-BBKJZ23O.js";
19
19
  export {
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  selectAssistantMessagesForSpeech,
43
43
  serializeToYaml,
44
44
  summarizeAssistantSpeech
45
- } from "./chunk-FUR4UVY6.js";
45
+ } from "./chunk-WQNH4XI6.js";
46
46
  import "./chunk-IWKP55ZB.js";
47
47
  import "./chunk-BBKJZ23O.js";
48
48
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.18.0-alpha.45",
3
+ "version": "0.18.0-alpha.46",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",