openmates 0.18.0-alpha.55 → 0.18.0-alpha.57

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.
@@ -5774,7 +5774,7 @@ function toArrayBuffer3(input) {
5774
5774
  var MAX_SPEECH_SEGMENTS = 20;
5775
5775
  var MAX_SEGMENT_CHARACTERS = 2e3;
5776
5776
  var FENCED_BLOCK = /^```[\s\S]*```$/;
5777
- function projectAssistantSpeech(content) {
5777
+ function projectAssistantSpeech(content, language = "en") {
5778
5778
  let nearestHeading = "";
5779
5779
  const paragraphs = content.split(/(```[\s\S]*?```)/g).flatMap(
5780
5780
  (block) => FENCED_BLOCK.test(block.trim()) ? [block] : block.split(/\n\n+/)
@@ -5786,10 +5786,10 @@ function projectAssistantSpeech(content) {
5786
5786
  const heading = paragraph.split("\n").map((line) => line.match(/^#{1,6}\s+(.+?)\s*#*$/)?.[1]?.trim()).find(Boolean);
5787
5787
  if (heading) nearestHeading = heading;
5788
5788
  }
5789
- const projected = projectParagraph(paragraph);
5789
+ const projected = projectParagraph(paragraph, language);
5790
5790
  for (const speakableText of splitLongParagraph(projected.speakableText)) {
5791
5791
  const semanticIdentity = `${projected.kind}:${speakableText}`;
5792
- if (projected.kind === "embed_summary" && speakableText === "Search results are available.") {
5792
+ if (projected.kind === "embed_summary") {
5793
5793
  if (semanticSummaries.has(semanticIdentity)) continue;
5794
5794
  semanticSummaries.add(semanticIdentity);
5795
5795
  }
@@ -5824,7 +5824,19 @@ function splitLongParagraph(paragraph) {
5824
5824
  if (remainder) chunks.push(remainder);
5825
5825
  return chunks;
5826
5826
  }
5827
- function projectFence(markdown) {
5827
+ function fallback(text2, language) {
5828
+ if (!language.toLowerCase().startsWith("de")) return text2;
5829
+ const german = {
5830
+ "Search results are available.": "Suchergebnisse sind verf\xFCgbar.",
5831
+ "I used the News Search skill.": "Ich habe die News-Suche verwendet.",
5832
+ "App results are available.": "App-Ergebnisse sind verf\xFCgbar.",
5833
+ "Structured data is available.": "Strukturierte Daten sind verf\xFCgbar.",
5834
+ "A code example is available.": "Ein Codebeispiel ist verf\xFCgbar.",
5835
+ "A table is available.": "Eine Tabelle ist verf\xFCgbar."
5836
+ };
5837
+ return german[text2] ?? text2;
5838
+ }
5839
+ function projectFence(markdown, language) {
5828
5840
  const body = markdown.replace(/^```[^\n]*\n|\n?```$/g, "").trim();
5829
5841
  let payload = null;
5830
5842
  try {
@@ -5833,24 +5845,24 @@ function projectFence(markdown) {
5833
5845
  } catch {
5834
5846
  }
5835
5847
  if (payload?.type === "app_skill_use") {
5836
- return { kind: "embed_summary", speakableText: payload.skill_id === "search" ? "Search results are available." : "App results are available." };
5848
+ return { kind: "embed_summary", speakableText: fallback(payload.skill_id === "search" ? payload.app_id === "news" ? "I used the News Search skill." : "Search results are available." : "App results are available.", language) };
5837
5849
  }
5838
5850
  if (payload && (payload.embed_id || ["website", "image", "audio", "video"].includes(String(payload.type)))) {
5839
- return { kind: "embed_summary", speakableText: "Structured data is available." };
5851
+ return { kind: "embed_summary", speakableText: fallback("Structured data is available.", language) };
5840
5852
  }
5841
- return { kind: "code_summary", speakableText: "A code example is available." };
5853
+ return { kind: "code_summary", speakableText: fallback("A code example is available.", language) };
5842
5854
  }
5843
- function projectParagraph(markdown) {
5855
+ function projectParagraph(markdown, language) {
5844
5856
  const trimmed = markdown.trim();
5845
- if (/^```[\s\S]*```$/.test(trimmed)) return projectFence(trimmed);
5857
+ if (/^```[\s\S]*```$/.test(trimmed)) return projectFence(trimmed, language);
5846
5858
  const lines = trimmed.split("\n").filter((line) => line.trim());
5847
5859
  if (lines.length >= 2 && lines.every((line) => /^\s*\|.*\|\s*$/.test(line))) {
5848
- return { kind: "table_summary", speakableText: "A table is available." };
5860
+ return { kind: "table_summary", speakableText: fallback("A table is available.", language) };
5849
5861
  }
5850
5862
  if (trimmed.startsWith("{") || trimmed.startsWith("[") && !/^\[[^\]]+\]\([^)]*\)/.test(trimmed)) {
5851
- return { kind: "embed_summary", speakableText: "Structured data is available." };
5863
+ return { kind: "embed_summary", speakableText: fallback("Structured data is available.", language) };
5852
5864
  }
5853
- const speakableText = trimmed.replace(/```[\s\S]*?```/g, (fence) => ` ${projectFence(fence).speakableText} `).replace(/^\s*\|.*\|\s*$/gm, " A table is available. ").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/`[^`]*`/g, "").replace(/(?:https?|ftp):\/\/[^\s)\]>]+|[a-z][a-z0-9+.-]*:\/\/[^\s)\]>]+/gi, "").replace(/(?:^|\s)[#>*_~]+|[_~]{1,3}/g, " ").replace(/\s+/g, " ").replace(/\s+([,.;:!?])/g, "$1").replace(/^[\s,;:-]+|[\s,;:-]+$/g, "");
5865
+ const speakableText = trimmed.replace(/```[\s\S]*?```/g, (fence) => ` ${projectFence(fence, language).speakableText} `).replace(/^\s*\|.*\|\s*$/gm, ` ${fallback("A table is available.", language)} `).replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/`[^`]*`/g, "").replace(/(?:https?|ftp):\/\/[^\s)\]>]+|[a-z][a-z0-9+.-]*:\/\/[^\s)\]>]+/gi, "").replace(/(?:^|\s)[#>*_~]+|[_~]{1,3}/g, " ").replace(/\s+/g, " ").replace(/\s+([,.;:!?])/g, "$1").replace(/^[\s,;:-]+|[\s,;:-]+$/g, "");
5854
5866
  return { kind: "prose_paragraph", speakableText };
5855
5867
  }
5856
5868
 
@@ -7328,9 +7340,9 @@ function withAppSkillPromptInjectionOption(inputData, promptInjectionProtection)
7328
7340
  }
7329
7341
  };
7330
7342
  }
7331
- function normalizeUnixSeconds(value, fallback) {
7343
+ function normalizeUnixSeconds(value, fallback2) {
7332
7344
  if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
7333
- return fallback;
7345
+ return fallback2;
7334
7346
  }
7335
7347
  return value > 1e10 ? Math.floor(value / 1e3) : Math.floor(value);
7336
7348
  }
@@ -8135,6 +8147,17 @@ function reconcileAuthoritativeChats(chats, evidence) {
8135
8147
  return (!authoritativeIds || authoritativeIds.has(chatId)) && !deletedIds.has(chatId);
8136
8148
  });
8137
8149
  }
8150
+ function buildInferenceHistoryMessage(historyMessage, chatId) {
8151
+ return {
8152
+ message_id: historyMessage.message_id,
8153
+ chat_id: chatId,
8154
+ role: historyMessage.role,
8155
+ sender_name: historyMessage.sender_name ?? historyMessage.role,
8156
+ content: historyMessage.content,
8157
+ created_at: historyMessage.created_at,
8158
+ category: historyMessage.role === "assistant" ? historyMessage.category : void 0
8159
+ };
8160
+ }
8138
8161
  var MATE_NAMES = {
8139
8162
  software_development: "Sophia",
8140
8163
  business_development: "Burton",
@@ -11203,10 +11226,9 @@ var OpenMatesClient = class _OpenMatesClient {
11203
11226
  };
11204
11227
  }
11205
11228
  if (params.incognito) {
11206
- const providedHistory = (params.messageHistory ?? []).map((historyMessage) => ({
11207
- ...historyMessage,
11208
- chat_id: historyMessage.chat_id ?? chatId
11209
- }));
11229
+ const providedHistory = (params.messageHistory ?? []).map(
11230
+ (historyMessage) => buildInferenceHistoryMessage(historyMessage, historyMessage.chat_id ?? chatId)
11231
+ );
11210
11232
  messagePayload.message_history = [...providedHistory, {
11211
11233
  message_id: messageId,
11212
11234
  chat_id: chatId,
@@ -11216,14 +11238,9 @@ var OpenMatesClient = class _OpenMatesClient {
11216
11238
  created_at: createdAt
11217
11239
  }];
11218
11240
  } else if (messageHistoryForRequest && messageHistoryForRequest.length > 0) {
11219
- messagePayload.message_history = messageHistoryForRequest.map((historyMessage) => ({
11220
- message_id: historyMessage.message_id,
11221
- chat_id: chatId,
11222
- role: historyMessage.role,
11223
- sender_name: historyMessage.sender_name ?? historyMessage.role,
11224
- content: historyMessage.content,
11225
- created_at: historyMessage.created_at
11226
- }));
11241
+ messagePayload.message_history = messageHistoryForRequest.map(
11242
+ (historyMessage) => buildInferenceHistoryMessage(historyMessage, chatId)
11243
+ );
11227
11244
  }
11228
11245
  if (params.preparedEmbeds && params.preparedEmbeds.length > 0) {
11229
11246
  messagePayload.embeds = params.preparedEmbeds.map((embed) => ({
@@ -15357,16 +15374,16 @@ Required: ${schema.required.join(", ")}`
15357
15374
  }
15358
15375
  return content;
15359
15376
  }
15360
- formatEmbedVersionError(data, fallback) {
15377
+ formatEmbedVersionError(data, fallback2) {
15361
15378
  if (data && typeof data === "object") {
15362
15379
  const detail = data.detail;
15363
15380
  const message = data.message;
15364
15381
  if (typeof detail === "string" && detail.trim()) return detail;
15365
15382
  if (typeof message === "string" && message.trim()) return message;
15366
15383
  }
15367
- return fallback;
15384
+ return fallback2;
15368
15385
  }
15369
- formatApplicationPreviewError(data, fallback) {
15386
+ formatApplicationPreviewError(data, fallback2) {
15370
15387
  if (data && typeof data === "object") {
15371
15388
  const detail = data.detail;
15372
15389
  const message = data.message;
@@ -15377,7 +15394,7 @@ Required: ${schema.required.join(", ")}`
15377
15394
  }
15378
15395
  if (typeof message === "string" && message.trim()) return message;
15379
15396
  }
15380
- return fallback;
15397
+ return fallback2;
15381
15398
  }
15382
15399
  async resolveEmbedId(embedIdOrShort) {
15383
15400
  if (embedIdOrShort.length >= 32) return embedIdOrShort;
@@ -69500,6 +69517,9 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
69500
69517
  confirmation_body: {
69501
69518
  text: "We have received your report and will look into it. You can reference your issue using the ID below."
69502
69519
  },
69520
+ confirmation_summary_title: {
69521
+ text: "Report summary"
69522
+ },
69503
69523
  confirmation_submit_another: {
69504
69524
  text: "Submit another report"
69505
69525
  },
@@ -69542,12 +69562,6 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
69542
69562
  screenshot_upload_failed: {
69543
69563
  text: "Failed to read the uploaded image."
69544
69564
  },
69545
- add_to_linear_label: {
69546
- text: "Add to Linear"
69547
- },
69548
- add_to_linear_hint: {
69549
- text: "Create a Linear issue to track this report on the project board."
69550
- },
69551
69565
  send_email_notification_label: {
69552
69566
  text: "Send email notification"
69553
69567
  },
@@ -75295,8 +75309,8 @@ function replaceTask(state, task) {
75295
75309
  if (index >= 0) state.tasks[index] = task;
75296
75310
  else state.tasks.unshift(task);
75297
75311
  }
75298
- function taskError(error, fallback) {
75299
- return error instanceof Error ? `${fallback} ${error.message}` : fallback;
75312
+ function taskError(error, fallback2) {
75313
+ return error instanceof Error ? `${fallback2} ${error.message}` : fallback2;
75300
75314
  }
75301
75315
  async function openWorkflowList(params) {
75302
75316
  const { state, client, render } = params;
@@ -75468,9 +75482,9 @@ async function cancelLatestWorkflowRun(params) {
75468
75482
  render();
75469
75483
  }
75470
75484
  }
75471
- function workflowError(error, fallback) {
75485
+ function workflowError(error, fallback2) {
75472
75486
  const details = error instanceof Error ? error.message : String(error);
75473
- return `${fallback} ${details}`;
75487
+ return `${fallback2} ${details}`;
75474
75488
  }
75475
75489
  function toggleInterest(state) {
75476
75490
  const interest = TUI_INTERESTS[state.selectedIndex];
@@ -78256,10 +78270,10 @@ function extractRecord(container, key) {
78256
78270
  if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`Workspace ask planning returned invalid ${key}.`);
78257
78271
  return value;
78258
78272
  }
78259
- function requiredString(record2, key, fallback) {
78273
+ function requiredString(record2, key, fallback2) {
78260
78274
  const value = record2[key];
78261
78275
  if (typeof value === "string" && value.trim()) return value.trim();
78262
- return fallback;
78276
+ return fallback2;
78263
78277
  }
78264
78278
  function optionalString(record2, key) {
78265
78279
  const value = record2[key];
@@ -80105,8 +80119,8 @@ function safeRelativeProjectPath(value) {
80105
80119
  if (parts.some((part) => part === "..")) throw new CliContractError("invalid_path", "Project file paths cannot traverse outside the source.");
80106
80120
  return normalized;
80107
80121
  }
80108
- function parseBoundedInteger(value, flag, minimum, maximum, fallback) {
80109
- if (value === void 0) return fallback;
80122
+ function parseBoundedInteger(value, flag, minimum, maximum, fallback2) {
80123
+ if (value === void 0) return fallback2;
80110
80124
  if (typeof value !== "string" || !/^\d+$/.test(value)) throw new CliContractError("invalid_limit", `${flag} must be an integer.`);
80111
80125
  const parsed = Number(value);
80112
80126
  if (parsed < minimum || parsed > maximum) throw new CliContractError("invalid_limit", `${flag} must be between ${minimum} and ${maximum}.`);
@@ -84535,12 +84549,12 @@ function parseUsageOverviewGranularity(value) {
84535
84549
  if (value === "daily" || value === "weekly" || value === "monthly") return value;
84536
84550
  throw new Error("Invalid --granularity. Use daily, weekly, or monthly.");
84537
84551
  }
84538
- function parseOptionalNumber(value, fallback, flag) {
84539
- if (value === void 0) return fallback;
84552
+ function parseOptionalNumber(value, fallback2, flag) {
84553
+ if (value === void 0) return fallback2;
84540
84554
  return parseRequiredNumber(value, flag);
84541
84555
  }
84542
- function parseOptionalBoolean(value, fallback, label) {
84543
- if (value === void 0) return fallback;
84556
+ function parseOptionalBoolean(value, fallback2, label) {
84557
+ if (value === void 0) return fallback2;
84544
84558
  if (typeof value === "boolean") return value;
84545
84559
  return parseOnOff(value, label);
84546
84560
  }
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  serializeToYaml,
14
14
  shouldRequireTrustedAccountGuard,
15
15
  waitForWorkflowRun
16
- } from "./chunk-RBHU2VQK.js";
16
+ } from "./chunk-2D4QF4PT.js";
17
17
  import "./chunk-IWKP55ZB.js";
18
18
  import "./chunk-BBKJZ23O.js";
19
19
  export {
package/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@ interface ProjectedAssistantSpeechSegment {
16
16
  type: "code" | "table" | "structured";
17
17
  };
18
18
  }
19
- declare function projectAssistantSpeech(content: string): ProjectedAssistantSpeechSegment[];
19
+ declare function projectAssistantSpeech(content: string, language?: string): ProjectedAssistantSpeechSegment[];
20
20
 
21
21
  /**
22
22
  * Owner-side helpers for historical assistant speech generation.
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  selectAssistantMessagesForSpeech,
43
43
  serializeToYaml,
44
44
  summarizeAssistantSpeech
45
- } from "./chunk-RBHU2VQK.js";
45
+ } from "./chunk-2D4QF4PT.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.55",
3
+ "version": "0.18.0-alpha.57",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",