openmates 0.12.0-alpha.19 → 0.12.0-alpha.20

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.
@@ -2805,13 +2805,21 @@ var OpenMatesClient = class _OpenMatesClient {
2805
2805
  }
2806
2806
  const chatId = `anonymous-${randomUUID2()}`;
2807
2807
  const messageId = `anonymous-message-${randomUUID2()}`;
2808
- const response = await this.http.post("/v1/anonymous/chat/stream", {
2808
+ const requestBody = {
2809
2809
  anonymous_id: anonymousId,
2810
2810
  client_chat_id: chatId,
2811
2811
  client_message_id: messageId,
2812
2812
  plaintext_message: params.message,
2813
2813
  message_history: []
2814
- });
2814
+ };
2815
+ if (params.learningMode?.enabled === true) {
2816
+ requestBody.learning_mode = {
2817
+ enabled: true,
2818
+ age_group: params.learningMode.ageGroup ?? null,
2819
+ source: params.learningMode.source ?? "anonymous_session"
2820
+ };
2821
+ }
2822
+ const response = await this.http.post("/v1/anonymous/chat/stream", requestBody);
2815
2823
  if (!response.ok) {
2816
2824
  const detail = response.data.detail;
2817
2825
  const message = typeof detail === "object" && detail?.message ? detail.message : typeof detail === "string" ? detail : `Anonymous chat failed with HTTP ${response.status}`;
@@ -37913,12 +37921,21 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
37913
37921
  learning_mode_disable_description: {
37914
37922
  text: "Enter the Learning Mode passcode to turn it off for this account."
37915
37923
  },
37924
+ learning_mode_guest_description: {
37925
+ text: "Choose the learner age group. For guests, Learning Mode lasts only for this browser session and has no passcode."
37926
+ },
37916
37927
  learning_mode_active_detail: {
37917
37928
  text: "Learning Mode is active for every chat on this account. Answers stay teaching-first and selected tools are restricted."
37918
37929
  },
37919
37930
  learning_mode_inactive_detail: {
37920
37931
  text: "When enabled, OpenMates guides the learner step by step instead of giving complete answers."
37921
37932
  },
37933
+ learning_mode_guest_active_detail: {
37934
+ text: "Learning Mode is active for anonymous chats in this browser session. Create an account to lock it with a passcode across devices."
37935
+ },
37936
+ learning_mode_guest_inactive_detail: {
37937
+ text: "Guests can try Learning Mode for anonymous chats in this browser session. Create an account to lock it with a passcode."
37938
+ },
37922
37939
  learning_mode_age_group_label: {
37923
37940
  text: "Learner age group"
37924
37941
  },
@@ -43141,7 +43158,8 @@ async function handleChats(client, subcommand, rest, flags, redactor) {
43141
43158
  json: flags.json === true,
43142
43159
  autoApproveSubChats: flags["auto-approve"] === true,
43143
43160
  autoApproveMemories: flags["auto-approve-memories"] === true,
43144
- piiDetection: flags["no-pii-detection"] !== true
43161
+ piiDetection: flags["no-pii-detection"] !== true,
43162
+ anonymousLearningMode: client.hasSession() ? void 0 : parseAnonymousLearningModeFlags(flags)
43145
43163
  },
43146
43164
  redactor
43147
43165
  );
@@ -45485,6 +45503,14 @@ function parseLearningModeAgeGroup(value) {
45485
45503
  }
45486
45504
  return value;
45487
45505
  }
45506
+ function parseAnonymousLearningModeFlags(flags) {
45507
+ if (flags["learning-mode"] !== true) return void 0;
45508
+ return {
45509
+ enabled: true,
45510
+ ageGroup: parseLearningModeAgeGroup(flags["age-group"]),
45511
+ source: "anonymous_session"
45512
+ };
45513
+ }
45488
45514
  function parseRequiredStringFlag(value, name) {
45489
45515
  if (typeof value !== "string" || value.length === 0) {
45490
45516
  throw new Error(`Provide ${name}.`);
@@ -46099,7 +46125,10 @@ async function sendMessageStreaming(client, params, redactor) {
46099
46125
  if (!client.hasSession()) {
46100
46126
  let result2;
46101
46127
  try {
46102
- result2 = await client.sendAnonymousMessage({ message: finalMessage });
46128
+ result2 = await client.sendAnonymousMessage({
46129
+ message: finalMessage,
46130
+ learningMode: params.anonymousLearningMode
46131
+ });
46103
46132
  } finally {
46104
46133
  clearTyping();
46105
46134
  }
@@ -47520,7 +47549,7 @@ function printChatsHelp() {
47520
47549
  openmates chats show <chat-id> [--raw] [--json]
47521
47550
  openmates chats open [<n|example-id|slug>] [--json]
47522
47551
  openmates chats search <query> [--json]
47523
- openmates chats new <message> [--json] [--auto-approve] [--auto-approve-memories] [--no-pii-detection]
47552
+ openmates chats new <message> [--json] [--learning-mode --age-group <group>] [--auto-approve] [--auto-approve-memories] [--no-pii-detection]
47524
47553
  openmates chats send [--chat <id>] [--incognito] <message> [--json] [--auto-approve] [--auto-approve-memories] [--no-pii-detection]
47525
47554
  openmates chats send --chat <id> --followup <n> [--json] [--auto-approve] [--auto-approve-memories]
47526
47555
  openmates chats answer-interactive --chat <id> --question-json '<json>' --answer-json '<json>' [--json]
@@ -47566,6 +47595,11 @@ Options for 'new', 'send', and 'incognito':
47566
47595
  --no-pii-detection Send the message exactly as typed. By default, the CLI
47567
47596
  replaces detected PII with placeholders before send.
47568
47597
 
47598
+ Guest-only options for logged-out 'new':
47599
+ --learning-mode Opt anonymous chat into request-scoped Learning Mode.
47600
+ --age-group <group> Required with --learning-mode: under_10, 10_12,
47601
+ 13_15, 16_18, or adult.
47602
+
47569
47603
  Options for 'download':
47570
47604
  --output <path> Target directory (default: current directory)
47571
47605
  --zip Create a .zip archive instead of a folder
@@ -47602,6 +47636,7 @@ Examples:
47602
47636
  openmates chats show "Flight Connections Berlin to Bangkok"
47603
47637
  openmates chats search "Madrid"
47604
47638
  openmates chats new "Hello, what can you help me with?"
47639
+ openmates chats new "Help me understand fractions" --learning-mode --age-group 10_12
47605
47640
  openmates chats send --chat d262cb68 "follow-up question"
47606
47641
  openmates chats send --chat d262cb68 --followup 1
47607
47642
  openmates chats send --chat d262cb68 --followup 3
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getExtForLang,
4
4
  serializeToYaml
5
- } from "./chunk-FTMMOTBN.js";
5
+ } from "./chunk-OSH7SOFJ.js";
6
6
  import "./chunk-AXNRPVLE.js";
7
7
  export {
8
8
  getExtForLang,
package/dist/index.d.ts CHANGED
@@ -259,6 +259,7 @@ interface LearningModeStatus {
259
259
  interface LearningModeContext {
260
260
  enabled: boolean;
261
261
  ageGroup?: LearningModeAgeGroup | null;
262
+ source?: "anonymous_session";
262
263
  }
263
264
  /** A single field definition within a memory type schema. */
264
265
  interface MemoryFieldDef {
@@ -533,6 +534,7 @@ declare class OpenMatesClient {
533
534
  getAnonymousFreeUsageStatus(): Promise<AnonymousFreeUsageStatus>;
534
535
  sendAnonymousMessage(params: {
535
536
  message: string;
537
+ learningMode?: LearningModeContext;
536
538
  }): Promise<{
537
539
  status: "completed";
538
540
  chatId: string;
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  deriveAppUrl,
10
10
  getExtForLang,
11
11
  serializeToYaml
12
- } from "./chunk-FTMMOTBN.js";
12
+ } from "./chunk-OSH7SOFJ.js";
13
13
  import "./chunk-AXNRPVLE.js";
14
14
  export {
15
15
  ASSISTANT_FEEDBACK_REPORT_TITLE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.12.0-alpha.19",
3
+ "version": "0.12.0-alpha.20",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",