openmates 0.12.0-alpha.16 → 0.12.0-alpha.18

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/README.md CHANGED
@@ -24,6 +24,7 @@ openmates apps list
24
24
  openmates apps ai ask "What is Docker?"
25
25
  openmates apps code run --language python --code 'print("Hello")'
26
26
  openmates settings account export data --json
27
+ openmates learning-mode status --json
27
28
  openmates settings memories list --json
28
29
  openmates docs list
29
30
  openmates benchmark model google/gemini-3.5-flash --dry-run --json
@@ -2979,6 +2979,41 @@ var OpenMatesClient = class _OpenMatesClient {
2979
2979
  saveSession(session);
2980
2980
  return response.data.user ?? {};
2981
2981
  }
2982
+ async getLearningModeStatus() {
2983
+ this.requireSession();
2984
+ const response = await this.http.get(
2985
+ "/v1/learning-mode",
2986
+ this.getCliRequestHeaders()
2987
+ );
2988
+ if (!response.ok) {
2989
+ throw new Error(`Learning Mode status failed with HTTP ${response.status}`);
2990
+ }
2991
+ return response.data;
2992
+ }
2993
+ async activateLearningMode(params) {
2994
+ this.requireSession();
2995
+ const response = await this.http.post(
2996
+ "/v1/learning-mode/activate",
2997
+ { age_group: params.ageGroup, passcode: params.passcode },
2998
+ this.getCliRequestHeaders()
2999
+ );
3000
+ if (!response.ok) {
3001
+ throw new Error(`Learning Mode activation failed with HTTP ${response.status}`);
3002
+ }
3003
+ return response.data;
3004
+ }
3005
+ async deactivateLearningMode(passcode) {
3006
+ this.requireSession();
3007
+ const response = await this.http.post(
3008
+ "/v1/learning-mode/deactivate",
3009
+ { passcode },
3010
+ this.getCliRequestHeaders()
3011
+ );
3012
+ if (!response.ok) {
3013
+ throw new Error(`Learning Mode deactivation failed with HTTP ${response.status}`);
3014
+ }
3015
+ return response.data;
3016
+ }
2982
3017
  async logout() {
2983
3018
  if (this.session) {
2984
3019
  await this.http.post("/v1/auth/logout", {}, this.getCliRequestHeaders()).catch(() => void 0);
@@ -3680,6 +3715,12 @@ var OpenMatesClient = class _OpenMatesClient {
3680
3715
  if (params.benchmarkMetadata) {
3681
3716
  messagePayload.benchmark_metadata = params.benchmarkMetadata;
3682
3717
  }
3718
+ if (params.learningMode) {
3719
+ messagePayload.learning_mode = {
3720
+ enabled: params.learningMode.enabled,
3721
+ age_group: params.learningMode.ageGroup ?? null
3722
+ };
3723
+ }
3683
3724
  if (params.incognito) {
3684
3725
  const providedHistory = (params.messageHistory ?? []).map((historyMessage) => ({
3685
3726
  ...historyMessage,
@@ -20689,7 +20730,7 @@ line_count: 37`,
20689
20730
  metadata: {
20690
20731
  featured: true,
20691
20732
  order: 2,
20692
- content_embed_examples: ["code.application"]
20733
+ content_embed_examples: []
20693
20734
  }
20694
20735
  };
20695
20736
 
@@ -26250,6 +26291,9 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
26250
26291
  anonymous_free_usage: {
26251
26292
  feature_notice: {
26252
26293
  text: "You are using free anonymous credits. File uploads, memories, chat sync, and some other features require creating an account."
26294
+ },
26295
+ daily_credits_exhausted: {
26296
+ text: "You used up your free daily credits. Sign up & buy credits to make full use of OpenMates."
26253
26297
  }
26254
26298
  },
26255
26299
  interactive_question_failed: {
@@ -27924,6 +27968,44 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
27924
27968
  account_created_second_login_info: {
27925
27969
  text: "If you signed up with a passkey, add password plus 2FA as a backup. If you signed up with password plus 2FA, add a passkey for faster secure login."
27926
27970
  },
27971
+ existing_account: {
27972
+ subject: {
27973
+ text: "An OpenMates account already exists for this email"
27974
+ },
27975
+ title: {
27976
+ text: "An account with your email already exists"
27977
+ },
27978
+ intro: {
27979
+ text: "Someone tried to create a new OpenMates account with this email address, but this email is already connected to an existing account."
27980
+ },
27981
+ saved_logins_title: {
27982
+ text: "Check your saved logins"
27983
+ },
27984
+ saved_logins_body: {
27985
+ text: "Your browser, password manager, or device may already have the login saved. Look for OpenMates in saved passwords or passkeys before creating a new account."
27986
+ },
27987
+ login_methods_title: {
27988
+ text: "Try your login methods"
27989
+ },
27990
+ login_methods_body: {
27991
+ text: "You can log in with a passkey, or with your password plus 2FA. If you set up backup codes, keep them ready for the 2FA step."
27992
+ },
27993
+ login_button: {
27994
+ text: "Log in to OpenMates"
27995
+ },
27996
+ recovery_key_title: {
27997
+ text: "Have your recovery key?"
27998
+ },
27999
+ recovery_key_body: {
28000
+ text: "If you do not remember your password or passkey but still have your recovery key, use recovery key login. It preserves your encrypted chats and account data."
28001
+ },
28002
+ recovery_button: {
28003
+ text: "Open login and use recovery key"
28004
+ },
28005
+ reset_warning: {
28006
+ text: "If you lost every login method and your recovery key, account reset is the last resort. Because OpenMates encrypts your data, resetting the account can permanently delete encrypted chats, memories, app settings, embeds, passkeys, and API keys."
28007
+ }
28008
+ },
27927
28009
  password_security_reminder: {
27928
28010
  subject: {
27929
28011
  text: "Action needed to secure your OpenMates account"
@@ -28941,6 +29023,9 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
28941
29023
  }
28942
29024
  },
28943
29025
  embeds: {
29026
+ learning_mode_shortened_notice: {
29027
+ text: "Shortened since Learning Mode is active."
29028
+ },
28944
29029
  weather: {
28945
29030
  rain_radar: {
28946
29031
  no_rain: {
@@ -37648,6 +37733,90 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
37648
37733
  incognito: {
37649
37734
  text: "Incognito"
37650
37735
  },
37736
+ learning_mode: {
37737
+ text: "Learning"
37738
+ },
37739
+ learning_mode_active: {
37740
+ text: "Active for all chats on this account"
37741
+ },
37742
+ learning_mode_inactive: {
37743
+ text: "Teach step-by-step instead of giving complete answers"
37744
+ },
37745
+ learning_mode_load_error: {
37746
+ text: "Could not load Learning Mode status."
37747
+ },
37748
+ learning_mode_save_error: {
37749
+ text: "Could not update Learning Mode."
37750
+ },
37751
+ learning_mode_enabled: {
37752
+ text: "Learning Mode enabled."
37753
+ },
37754
+ learning_mode_disabled: {
37755
+ text: "Learning Mode disabled."
37756
+ },
37757
+ learning_mode_age_group_prompt: {
37758
+ text: "Learner age group: under_10, 10_12, 13_15, 16_18, or adult"
37759
+ },
37760
+ learning_mode_enable_passcode_prompt: {
37761
+ text: "Set a Learning Mode passcode."
37762
+ },
37763
+ learning_mode_disable_passcode_prompt: {
37764
+ text: "Enter the Learning Mode passcode to disable it."
37765
+ },
37766
+ learning_mode_invalid_age_group: {
37767
+ text: "Invalid age group. Use under_10, 10_12, 13_15, 16_18, or adult."
37768
+ },
37769
+ learning_mode_enable_description: {
37770
+ text: "Choose the learner age group and set a passcode. Learning Mode will apply to every chat on this account."
37771
+ },
37772
+ learning_mode_disable_description: {
37773
+ text: "Enter the Learning Mode passcode to turn it off for this account."
37774
+ },
37775
+ learning_mode_active_detail: {
37776
+ text: "Learning Mode is active for every chat on this account. Answers stay teaching-first and selected tools are restricted."
37777
+ },
37778
+ learning_mode_inactive_detail: {
37779
+ text: "When enabled, OpenMates guides the learner step by step instead of giving complete answers."
37780
+ },
37781
+ learning_mode_age_group_label: {
37782
+ text: "Learner age group"
37783
+ },
37784
+ learning_mode_age_under_10: {
37785
+ text: "Under 10"
37786
+ },
37787
+ learning_mode_age_10_12: {
37788
+ text: "10 to 12"
37789
+ },
37790
+ learning_mode_age_13_15: {
37791
+ text: "13 to 15"
37792
+ },
37793
+ learning_mode_age_16_18: {
37794
+ text: "16 to 18"
37795
+ },
37796
+ learning_mode_age_adult: {
37797
+ text: "Adult"
37798
+ },
37799
+ learning_mode_enable_passcode_label: {
37800
+ text: "Set passcode"
37801
+ },
37802
+ learning_mode_disable_passcode_label: {
37803
+ text: "Enter passcode"
37804
+ },
37805
+ learning_mode_enable_passcode_placeholder: {
37806
+ text: "Create a passcode"
37807
+ },
37808
+ learning_mode_disable_passcode_placeholder: {
37809
+ text: "Learning Mode passcode"
37810
+ },
37811
+ learning_mode_passcode_required: {
37812
+ text: "Enter a passcode to continue."
37813
+ },
37814
+ learning_mode_enable_button: {
37815
+ text: "Start Learning Mode"
37816
+ },
37817
+ learning_mode_disable_button: {
37818
+ text: "Turn off Learning Mode"
37819
+ },
37651
37820
  incognito_explainer_description: {
37652
37821
  text: "Incognito mode applies only to new chats you create. New chats created while incognito mode is active are not synced across devices, not stored on the server, and not cached. These chats exist only in your current browser session. Existing chats remain unchanged."
37653
37822
  },
@@ -42645,6 +42814,10 @@ async function main() {
42645
42814
  printSettingsHelp(client);
42646
42815
  return;
42647
42816
  }
42817
+ if (command === "learning-mode") {
42818
+ printLearningModeHelp();
42819
+ return;
42820
+ }
42648
42821
  if (command === "signup") {
42649
42822
  printSignupHelp();
42650
42823
  return;
@@ -42743,6 +42916,10 @@ async function main() {
42743
42916
  await handleSettings(client, subcommand, rest, parsed.flags);
42744
42917
  return;
42745
42918
  }
42919
+ if (command === "learning-mode") {
42920
+ await handleLearningMode(client, subcommand, parsed.flags);
42921
+ return;
42922
+ }
42746
42923
  if (command === "inspirations") {
42747
42924
  await handleInspirations(client, parsed.flags);
42748
42925
  return;
@@ -45126,6 +45303,71 @@ async function handleSettings(client, subcommand, rest, flags) {
45126
45303
  printSettingsHelp(client, [subcommand]);
45127
45304
  process.exit(1);
45128
45305
  }
45306
+ var LEARNING_MODE_AGE_GROUPS = /* @__PURE__ */ new Set([
45307
+ "under_10",
45308
+ "10_12",
45309
+ "13_15",
45310
+ "16_18",
45311
+ "adult"
45312
+ ]);
45313
+ async function handleLearningMode(client, subcommand, flags) {
45314
+ if (!subcommand || subcommand === "help" || flags.help === true) {
45315
+ printLearningModeHelp();
45316
+ return;
45317
+ }
45318
+ if (subcommand === "status") {
45319
+ printLearningModeStatus(await client.getLearningModeStatus(), flags.json === true);
45320
+ return;
45321
+ }
45322
+ if (subcommand === "enable") {
45323
+ const ageGroup = parseLearningModeAgeGroup(flags["age-group"]);
45324
+ const passcode = parseRequiredStringFlag(flags.passcode, "--passcode");
45325
+ printLearningModeStatus(
45326
+ await client.activateLearningMode({ ageGroup, passcode }),
45327
+ flags.json === true
45328
+ );
45329
+ return;
45330
+ }
45331
+ if (subcommand === "disable") {
45332
+ const passcode = parseRequiredStringFlag(flags.passcode, "--passcode");
45333
+ printLearningModeStatus(await client.deactivateLearningMode(passcode), flags.json === true);
45334
+ return;
45335
+ }
45336
+ console.error(`Unknown learning-mode command '${subcommand}'.
45337
+ `);
45338
+ printLearningModeHelp();
45339
+ process.exit(1);
45340
+ }
45341
+ function parseLearningModeAgeGroup(value) {
45342
+ if (typeof value !== "string" || !LEARNING_MODE_AGE_GROUPS.has(value)) {
45343
+ throw new Error("Provide --age-group as one of: under_10, 10_12, 13_15, 16_18, adult.");
45344
+ }
45345
+ return value;
45346
+ }
45347
+ function parseRequiredStringFlag(value, name) {
45348
+ if (typeof value !== "string" || value.length === 0) {
45349
+ throw new Error(`Provide ${name}.`);
45350
+ }
45351
+ return value;
45352
+ }
45353
+ function printLearningModeStatus(status, json) {
45354
+ if (json) {
45355
+ printJson2(status);
45356
+ return;
45357
+ }
45358
+ console.log(`Learning Mode: ${status.enabled ? "enabled" : "disabled"}`);
45359
+ if (status.age_group) console.log(`Age group: ${status.age_group}`);
45360
+ if (status.failed_attempts > 0) console.log(`Failed disable attempts: ${status.failed_attempts}`);
45361
+ if (status.deactivation_blocked_until) {
45362
+ console.log(`Disable blocked until: ${new Date(status.deactivation_blocked_until * 1e3).toISOString()}`);
45363
+ }
45364
+ }
45365
+ function learningModeStatusToContext(status) {
45366
+ return {
45367
+ enabled: status.enabled,
45368
+ ageGroup: status.age_group
45369
+ };
45370
+ }
45129
45371
  async function handleMemories(client, rest, flags) {
45130
45372
  const action = rest[0];
45131
45373
  if (!action || action === "help") {
@@ -45737,6 +45979,7 @@ async function sendMessageStreaming(client, params, redactor) {
45737
45979
  const urlResult = prepareUrlEmbeds(finalMessage);
45738
45980
  finalMessage = urlResult.message;
45739
45981
  preparedEmbeds.push(...urlResult.embeds);
45982
+ const learningMode = learningModeStatusToContext(await client.getLearningModeStatus());
45740
45983
  const result = await client.sendMessage({
45741
45984
  message: finalMessage,
45742
45985
  chatId: params.chatId,
@@ -45746,6 +45989,7 @@ async function sendMessageStreaming(client, params, redactor) {
45746
45989
  onSubChatApprovalRequest,
45747
45990
  autoApproveSubChats: params.autoApproveSubChats,
45748
45991
  autoApproveMemories: params.autoApproveMemories,
45992
+ learningMode,
45749
45993
  preparedEmbeds: preparedEmbeds.length > 0 ? preparedEmbeds : void 0,
45750
45994
  piiMappings: piiResult.mappings.map((mapping) => ({
45751
45995
  placeholder: mapping.placeholder,
@@ -47052,6 +47296,7 @@ Commands:
47052
47296
  openmates mentions [--help] List available @mentions
47053
47297
  openmates embeds [--help] Embed commands (show)
47054
47298
  openmates settings [--help] Predefined settings commands
47299
+ openmates learning-mode [--help] Account-wide Learning Mode controls
47055
47300
  openmates inspirations [--lang <code>] [--json] Daily inspirations
47056
47301
  openmates newchatsuggestions [--limit <n>] [--json] Personalized new chat suggestions
47057
47302
  openmates feedback [--help] Assistant response feedback helpers
@@ -47078,6 +47323,22 @@ Options:
47078
47323
  --rating <1-5> Required star rating
47079
47324
  --json Output the decision contract as JSON`);
47080
47325
  }
47326
+ function printLearningModeHelp() {
47327
+ console.log(`Learning Mode commands:
47328
+ openmates learning-mode status [--json]
47329
+ openmates learning-mode enable --age-group <group> --passcode <passcode> [--json]
47330
+ openmates learning-mode disable --passcode <passcode> [--json]
47331
+
47332
+ Learning Mode is account-wide and applies to CLI, web, Apple, and API chat requests.
47333
+
47334
+ Age groups:
47335
+ under_10, 10_12, 13_15, 16_18, adult
47336
+
47337
+ Options:
47338
+ --age-group <group> Required for enable
47339
+ --passcode <value> Required for enable and disable
47340
+ --json Output backend status JSON`);
47341
+ }
47081
47342
  function printSignupHelp() {
47082
47343
  console.log(`Signup command:
47083
47344
  openmates signup --email <email> --username <name> --invite-code <code>
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getExtForLang,
4
4
  serializeToYaml
5
- } from "./chunk-2L7XCIUT.js";
5
+ } from "./chunk-L5U4RDFT.js";
6
6
  import "./chunk-AXNRPVLE.js";
7
7
  export {
8
8
  getExtForLang,
package/dist/index.d.ts CHANGED
@@ -249,6 +249,17 @@ interface ConnectedAccountTurnTokenRef {
249
249
  action_scope?: Record<string, unknown>;
250
250
  expires_at: number;
251
251
  }
252
+ type LearningModeAgeGroup = "under_10" | "10_12" | "13_15" | "16_18" | "adult";
253
+ interface LearningModeStatus {
254
+ enabled: boolean;
255
+ age_group: LearningModeAgeGroup | null;
256
+ failed_attempts: number;
257
+ deactivation_blocked_until: number | null;
258
+ }
259
+ interface LearningModeContext {
260
+ enabled: boolean;
261
+ ageGroup?: LearningModeAgeGroup | null;
262
+ }
252
263
  /** A single field definition within a memory type schema. */
253
264
  interface MemoryFieldDef {
254
265
  type: string;
@@ -557,6 +568,12 @@ declare class OpenMatesClient {
557
568
  }): Promise<Record<string, unknown>>;
558
569
  loginWithPairAuth(): Promise<void>;
559
570
  whoAmI(): Promise<Record<string, unknown>>;
571
+ getLearningModeStatus(): Promise<LearningModeStatus>;
572
+ activateLearningMode(params: {
573
+ ageGroup: LearningModeAgeGroup;
574
+ passcode: string;
575
+ }): Promise<LearningModeStatus>;
576
+ deactivateLearningMode(passcode: string): Promise<LearningModeStatus>;
560
577
  logout(): Promise<void>;
561
578
  requestSignupEmailCode(params: {
562
579
  email: string;
@@ -709,6 +726,8 @@ declare class OpenMatesClient {
709
726
  benchmarkMetadata?: BenchmarkMetadata;
710
727
  /** Full plaintext history for incognito benchmark turns. */
711
728
  messageHistory?: BenchmarkHistoryMessage[];
729
+ /** Account-wide Learning Mode context when already known by the caller. */
730
+ learningMode?: LearningModeContext;
712
731
  /** Start collecting before send for latency-sensitive benchmark turns. */
713
732
  precollectResponse?: boolean;
714
733
  }): Promise<{
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  deriveAppUrl,
10
10
  getExtForLang,
11
11
  serializeToYaml
12
- } from "./chunk-2L7XCIUT.js";
12
+ } from "./chunk-L5U4RDFT.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.16",
3
+ "version": "0.12.0-alpha.18",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",