openmates 0.9.0-alpha.1 → 0.9.0-alpha.3
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/dist/{chunk-5J4IXPQ3.js → chunk-QWU5GCDA.js} +93 -37
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -730,6 +730,49 @@ var OpenMatesWsClient = class {
|
|
|
730
730
|
this.socket.on("close", onClose);
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
+
/**
|
|
734
|
+
* Collect all frames until `terminatorType` arrives (or timeout).
|
|
735
|
+
* Returns every frame received before the terminator, in order.
|
|
736
|
+
* Used by ensureSynced to consume the full phased-sync event stream.
|
|
737
|
+
*/
|
|
738
|
+
collectMessages(terminatorType, timeoutMs = 9e4) {
|
|
739
|
+
return new Promise((resolve4, reject) => {
|
|
740
|
+
const collected = [];
|
|
741
|
+
const onMessage = (rawData) => {
|
|
742
|
+
try {
|
|
743
|
+
const parsed = JSON.parse(rawData.toString());
|
|
744
|
+
if (parsed.type === terminatorType) {
|
|
745
|
+
cleanup();
|
|
746
|
+
resolve4(collected);
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
collected.push(parsed);
|
|
750
|
+
} catch {
|
|
751
|
+
}
|
|
752
|
+
};
|
|
753
|
+
const onError = (error) => {
|
|
754
|
+
cleanup();
|
|
755
|
+
reject(error);
|
|
756
|
+
};
|
|
757
|
+
const onClose = () => {
|
|
758
|
+
cleanup();
|
|
759
|
+
resolve4(collected);
|
|
760
|
+
};
|
|
761
|
+
const timeout = setTimeout(() => {
|
|
762
|
+
cleanup();
|
|
763
|
+
reject(new Error(`Timeout waiting for '${terminatorType}'`));
|
|
764
|
+
}, timeoutMs);
|
|
765
|
+
const cleanup = () => {
|
|
766
|
+
clearTimeout(timeout);
|
|
767
|
+
this.socket.off("message", onMessage);
|
|
768
|
+
this.socket.off("error", onError);
|
|
769
|
+
this.socket.off("close", onClose);
|
|
770
|
+
};
|
|
771
|
+
this.socket.on("message", onMessage);
|
|
772
|
+
this.socket.on("error", onError);
|
|
773
|
+
this.socket.on("close", onClose);
|
|
774
|
+
});
|
|
775
|
+
}
|
|
733
776
|
/**
|
|
734
777
|
* Collect the AI response for a sent message.
|
|
735
778
|
*
|
|
@@ -902,10 +945,11 @@ var OpenMatesWsClient = class {
|
|
|
902
945
|
|
|
903
946
|
// src/mentions.ts
|
|
904
947
|
var MODEL_ALIASES = {
|
|
905
|
-
best: "claude-opus-4-
|
|
948
|
+
best: "claude-opus-4-7",
|
|
906
949
|
fast: "qwen3-235b-a22b-2507"
|
|
907
950
|
};
|
|
908
951
|
var CHAT_MODELS = [
|
|
952
|
+
{ id: "claude-opus-4-7", name: "Claude Opus 4.7" },
|
|
909
953
|
{ id: "claude-opus-4-6", name: "Claude Opus 4.6" },
|
|
910
954
|
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
|
|
911
955
|
{ id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5" },
|
|
@@ -3229,41 +3273,53 @@ Required: ${schema.required.join(", ")}`
|
|
|
3229
3273
|
let totalChatCount = 0;
|
|
3230
3274
|
try {
|
|
3231
3275
|
ws.send("phased_sync_request", {
|
|
3232
|
-
phase: "
|
|
3276
|
+
phase: "all",
|
|
3233
3277
|
client_chat_versions: clientChatVersions,
|
|
3234
3278
|
client_chat_ids: clientChatIds,
|
|
3235
3279
|
client_embed_ids: clientEmbedIds
|
|
3236
3280
|
});
|
|
3237
|
-
const
|
|
3238
|
-
const
|
|
3239
|
-
const
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3281
|
+
const frames = await ws.collectMessages("phased_sync_complete", 9e4);
|
|
3282
|
+
const messagesByChatId = /* @__PURE__ */ new Map();
|
|
3283
|
+
for (const frame of frames) {
|
|
3284
|
+
if (frame.type === "phase_1_last_chat_ready") {
|
|
3285
|
+
const p = frame.payload;
|
|
3286
|
+
newChatSuggestions = p.new_chat_suggestions ?? [];
|
|
3287
|
+
} else if (frame.type === "phase_1b_chat_content_ready") {
|
|
3288
|
+
const p = frame.payload;
|
|
3289
|
+
for (const c of p.chats ?? []) {
|
|
3290
|
+
if (c.chat_id && Array.isArray(c.messages) && c.messages.length > 0) {
|
|
3291
|
+
messagesByChatId.set(c.chat_id, c.messages);
|
|
3292
|
+
}
|
|
3293
|
+
}
|
|
3294
|
+
if (p.embeds) embeds.push(...p.embeds);
|
|
3295
|
+
if (p.embed_keys) embedKeys.push(...p.embed_keys);
|
|
3296
|
+
} else if (frame.type === "phase_2_last_20_chats_ready") {
|
|
3297
|
+
const p = frame.payload;
|
|
3298
|
+
totalChatCount = p.total_chat_count ?? 0;
|
|
3299
|
+
for (const wrapper of p.chats ?? []) {
|
|
3300
|
+
const details = wrapper.chat_details;
|
|
3301
|
+
if (!details || typeof details.id !== "string") continue;
|
|
3302
|
+
chats.push({ details, messages: [] });
|
|
3303
|
+
}
|
|
3304
|
+
} else if (frame.type === "background_message_sync") {
|
|
3305
|
+
const p = frame.payload;
|
|
3306
|
+
for (const c of p.chats ?? []) {
|
|
3307
|
+
if (c.chat_id && Array.isArray(c.messages) && c.messages.length > 0) {
|
|
3308
|
+
messagesByChatId.set(c.chat_id, c.messages);
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
if (p.embeds) embeds.push(...p.embeds);
|
|
3312
|
+
if (p.embed_keys) embedKeys.push(...p.embed_keys);
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
for (const chat of chats) {
|
|
3316
|
+
const id = typeof chat.details.id === "string" ? chat.details.id : "";
|
|
3317
|
+
const msgs = messagesByChatId.get(id);
|
|
3318
|
+
if (msgs && msgs.length > 0) {
|
|
3319
|
+
chat.messages = msgs;
|
|
3261
3320
|
}
|
|
3262
|
-
if (payload.embeds) embeds.push(...payload.embeds);
|
|
3263
|
-
if (payload.embed_keys) embedKeys.push(...payload.embed_keys);
|
|
3264
|
-
offset += batch.length;
|
|
3265
|
-
if (!payload.has_more || batch.length === 0) break;
|
|
3266
3321
|
}
|
|
3322
|
+
if (totalChatCount === 0) totalChatCount = chats.length;
|
|
3267
3323
|
} finally {
|
|
3268
3324
|
ws.close();
|
|
3269
3325
|
}
|
|
@@ -4084,7 +4140,7 @@ var OutputRedactor = class {
|
|
|
4084
4140
|
}
|
|
4085
4141
|
/**
|
|
4086
4142
|
* Initialize the redactor by loading personal data entries from
|
|
4087
|
-
* the user's encrypted
|
|
4143
|
+
* the user's encrypted Memories.
|
|
4088
4144
|
*
|
|
4089
4145
|
* Safe to call without a session — silently skips if not logged in.
|
|
4090
4146
|
*
|
|
@@ -9135,7 +9191,7 @@ async function handleMentions(client, subcommand, _rest, flags) {
|
|
|
9135
9191
|
mate: "Mates",
|
|
9136
9192
|
skill: "Skills",
|
|
9137
9193
|
focus_mode: "Focus Modes",
|
|
9138
|
-
settings_memory: "
|
|
9194
|
+
settings_memory: "Memories"
|
|
9139
9195
|
};
|
|
9140
9196
|
for (const [type, items] of grouped) {
|
|
9141
9197
|
const label = typeLabels[type] || type;
|
|
@@ -9305,7 +9361,7 @@ Types:
|
|
|
9305
9361
|
mate AI mates/personas (@Sophia, @Finn)
|
|
9306
9362
|
skill App skills (@Web-Search, @Code-Get-Docs)
|
|
9307
9363
|
focus_mode Focus modes (@Web-Research)
|
|
9308
|
-
settings_memory
|
|
9364
|
+
settings_memory Memories (@Code-Projects)
|
|
9309
9365
|
|
|
9310
9366
|
Use @mentions in chat messages:
|
|
9311
9367
|
openmates chats new "@Sophia tell me about React hooks"
|
|
@@ -9324,7 +9380,7 @@ Commands:
|
|
|
9324
9380
|
openmates apps [--help] App skill commands (list, run, ...)
|
|
9325
9381
|
openmates mentions [--help] List available @mentions
|
|
9326
9382
|
openmates embeds [--help] Embed commands (show)
|
|
9327
|
-
openmates settings [--help]
|
|
9383
|
+
openmates settings [--help] Memories
|
|
9328
9384
|
openmates inspirations [--lang <code>] [--json] Daily inspirations
|
|
9329
9385
|
openmates newchatsuggestions [--limit <n>] [--json] Personalized new chat suggestions
|
|
9330
9386
|
openmates server [--help] Server management (install, start, stop, ...)
|
|
@@ -9389,7 +9445,7 @@ Options for 'delete':
|
|
|
9389
9445
|
@Claude-Opus-4.6 Specific model
|
|
9390
9446
|
@Sophia AI mate/persona
|
|
9391
9447
|
@Web-Search App skill
|
|
9392
|
-
@Code-Projects
|
|
9448
|
+
@Code-Projects Memories
|
|
9393
9449
|
@/path/to/file.ts Attach local file (secrets auto-redacted)
|
|
9394
9450
|
|
|
9395
9451
|
Sensitive files (.env) use zero-knowledge mode (only names + last 3 chars).
|
|
@@ -9515,8 +9571,8 @@ ${h("Interface")}
|
|
|
9515
9571
|
openmates settings post user/language --data '{"language":"en"}'
|
|
9516
9572
|
openmates settings post user/darkmode --data '{"dark_mode":true}'
|
|
9517
9573
|
openmates settings post ai-model-defaults --data '{"simple":"...","complex":"..."}'
|
|
9518
|
-
${h("
|
|
9519
|
-
openmates apps list Same as
|
|
9574
|
+
${h("Apps")}
|
|
9575
|
+
openmates apps list Same as Apps
|
|
9520
9576
|
openmates apps <app-id> App details
|
|
9521
9577
|
\x1B[2mWeb: ${s("app_store")}\x1B[0m
|
|
9522
9578
|
${h("Mates")}
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED