openmates 0.12.0-alpha.16 → 0.12.0-alpha.17

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
 
@@ -28941,6 +28982,9 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
28941
28982
  }
28942
28983
  },
28943
28984
  embeds: {
28985
+ learning_mode_shortened_notice: {
28986
+ text: "Shortened since Learning Mode is active."
28987
+ },
28944
28988
  weather: {
28945
28989
  rain_radar: {
28946
28990
  no_rain: {
@@ -37648,6 +37692,39 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
37648
37692
  incognito: {
37649
37693
  text: "Incognito"
37650
37694
  },
37695
+ learning_mode: {
37696
+ text: "Learning Mode"
37697
+ },
37698
+ learning_mode_active: {
37699
+ text: "Active for all chats on this account"
37700
+ },
37701
+ learning_mode_inactive: {
37702
+ text: "Teach step-by-step instead of giving complete answers"
37703
+ },
37704
+ learning_mode_load_error: {
37705
+ text: "Could not load Learning Mode status."
37706
+ },
37707
+ learning_mode_save_error: {
37708
+ text: "Could not update Learning Mode."
37709
+ },
37710
+ learning_mode_enabled: {
37711
+ text: "Learning Mode enabled."
37712
+ },
37713
+ learning_mode_disabled: {
37714
+ text: "Learning Mode disabled."
37715
+ },
37716
+ learning_mode_age_group_prompt: {
37717
+ text: "Learner age group: under_10, 10_12, 13_15, 16_18, or adult"
37718
+ },
37719
+ learning_mode_enable_passcode_prompt: {
37720
+ text: "Set a Learning Mode passcode."
37721
+ },
37722
+ learning_mode_disable_passcode_prompt: {
37723
+ text: "Enter the Learning Mode passcode to disable it."
37724
+ },
37725
+ learning_mode_invalid_age_group: {
37726
+ text: "Invalid age group. Use under_10, 10_12, 13_15, 16_18, or adult."
37727
+ },
37651
37728
  incognito_explainer_description: {
37652
37729
  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
37730
  },
@@ -42645,6 +42722,10 @@ async function main() {
42645
42722
  printSettingsHelp(client);
42646
42723
  return;
42647
42724
  }
42725
+ if (command === "learning-mode") {
42726
+ printLearningModeHelp();
42727
+ return;
42728
+ }
42648
42729
  if (command === "signup") {
42649
42730
  printSignupHelp();
42650
42731
  return;
@@ -42743,6 +42824,10 @@ async function main() {
42743
42824
  await handleSettings(client, subcommand, rest, parsed.flags);
42744
42825
  return;
42745
42826
  }
42827
+ if (command === "learning-mode") {
42828
+ await handleLearningMode(client, subcommand, parsed.flags);
42829
+ return;
42830
+ }
42746
42831
  if (command === "inspirations") {
42747
42832
  await handleInspirations(client, parsed.flags);
42748
42833
  return;
@@ -45126,6 +45211,71 @@ async function handleSettings(client, subcommand, rest, flags) {
45126
45211
  printSettingsHelp(client, [subcommand]);
45127
45212
  process.exit(1);
45128
45213
  }
45214
+ var LEARNING_MODE_AGE_GROUPS = /* @__PURE__ */ new Set([
45215
+ "under_10",
45216
+ "10_12",
45217
+ "13_15",
45218
+ "16_18",
45219
+ "adult"
45220
+ ]);
45221
+ async function handleLearningMode(client, subcommand, flags) {
45222
+ if (!subcommand || subcommand === "help" || flags.help === true) {
45223
+ printLearningModeHelp();
45224
+ return;
45225
+ }
45226
+ if (subcommand === "status") {
45227
+ printLearningModeStatus(await client.getLearningModeStatus(), flags.json === true);
45228
+ return;
45229
+ }
45230
+ if (subcommand === "enable") {
45231
+ const ageGroup = parseLearningModeAgeGroup(flags["age-group"]);
45232
+ const passcode = parseRequiredStringFlag(flags.passcode, "--passcode");
45233
+ printLearningModeStatus(
45234
+ await client.activateLearningMode({ ageGroup, passcode }),
45235
+ flags.json === true
45236
+ );
45237
+ return;
45238
+ }
45239
+ if (subcommand === "disable") {
45240
+ const passcode = parseRequiredStringFlag(flags.passcode, "--passcode");
45241
+ printLearningModeStatus(await client.deactivateLearningMode(passcode), flags.json === true);
45242
+ return;
45243
+ }
45244
+ console.error(`Unknown learning-mode command '${subcommand}'.
45245
+ `);
45246
+ printLearningModeHelp();
45247
+ process.exit(1);
45248
+ }
45249
+ function parseLearningModeAgeGroup(value) {
45250
+ if (typeof value !== "string" || !LEARNING_MODE_AGE_GROUPS.has(value)) {
45251
+ throw new Error("Provide --age-group as one of: under_10, 10_12, 13_15, 16_18, adult.");
45252
+ }
45253
+ return value;
45254
+ }
45255
+ function parseRequiredStringFlag(value, name) {
45256
+ if (typeof value !== "string" || value.length === 0) {
45257
+ throw new Error(`Provide ${name}.`);
45258
+ }
45259
+ return value;
45260
+ }
45261
+ function printLearningModeStatus(status, json) {
45262
+ if (json) {
45263
+ printJson2(status);
45264
+ return;
45265
+ }
45266
+ console.log(`Learning Mode: ${status.enabled ? "enabled" : "disabled"}`);
45267
+ if (status.age_group) console.log(`Age group: ${status.age_group}`);
45268
+ if (status.failed_attempts > 0) console.log(`Failed disable attempts: ${status.failed_attempts}`);
45269
+ if (status.deactivation_blocked_until) {
45270
+ console.log(`Disable blocked until: ${new Date(status.deactivation_blocked_until * 1e3).toISOString()}`);
45271
+ }
45272
+ }
45273
+ function learningModeStatusToContext(status) {
45274
+ return {
45275
+ enabled: status.enabled,
45276
+ ageGroup: status.age_group
45277
+ };
45278
+ }
45129
45279
  async function handleMemories(client, rest, flags) {
45130
45280
  const action = rest[0];
45131
45281
  if (!action || action === "help") {
@@ -45737,6 +45887,7 @@ async function sendMessageStreaming(client, params, redactor) {
45737
45887
  const urlResult = prepareUrlEmbeds(finalMessage);
45738
45888
  finalMessage = urlResult.message;
45739
45889
  preparedEmbeds.push(...urlResult.embeds);
45890
+ const learningMode = learningModeStatusToContext(await client.getLearningModeStatus());
45740
45891
  const result = await client.sendMessage({
45741
45892
  message: finalMessage,
45742
45893
  chatId: params.chatId,
@@ -45746,6 +45897,7 @@ async function sendMessageStreaming(client, params, redactor) {
45746
45897
  onSubChatApprovalRequest,
45747
45898
  autoApproveSubChats: params.autoApproveSubChats,
45748
45899
  autoApproveMemories: params.autoApproveMemories,
45900
+ learningMode,
45749
45901
  preparedEmbeds: preparedEmbeds.length > 0 ? preparedEmbeds : void 0,
45750
45902
  piiMappings: piiResult.mappings.map((mapping) => ({
45751
45903
  placeholder: mapping.placeholder,
@@ -47052,6 +47204,7 @@ Commands:
47052
47204
  openmates mentions [--help] List available @mentions
47053
47205
  openmates embeds [--help] Embed commands (show)
47054
47206
  openmates settings [--help] Predefined settings commands
47207
+ openmates learning-mode [--help] Account-wide Learning Mode controls
47055
47208
  openmates inspirations [--lang <code>] [--json] Daily inspirations
47056
47209
  openmates newchatsuggestions [--limit <n>] [--json] Personalized new chat suggestions
47057
47210
  openmates feedback [--help] Assistant response feedback helpers
@@ -47078,6 +47231,22 @@ Options:
47078
47231
  --rating <1-5> Required star rating
47079
47232
  --json Output the decision contract as JSON`);
47080
47233
  }
47234
+ function printLearningModeHelp() {
47235
+ console.log(`Learning Mode commands:
47236
+ openmates learning-mode status [--json]
47237
+ openmates learning-mode enable --age-group <group> --passcode <passcode> [--json]
47238
+ openmates learning-mode disable --passcode <passcode> [--json]
47239
+
47240
+ Learning Mode is account-wide and applies to CLI, web, Apple, and API chat requests.
47241
+
47242
+ Age groups:
47243
+ under_10, 10_12, 13_15, 16_18, adult
47244
+
47245
+ Options:
47246
+ --age-group <group> Required for enable
47247
+ --passcode <value> Required for enable and disable
47248
+ --json Output backend status JSON`);
47249
+ }
47081
47250
  function printSignupHelp() {
47082
47251
  console.log(`Signup command:
47083
47252
  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-OSMG5HH3.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-OSMG5HH3.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.17",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",