openmates 0.27.0-alpha.67 → 0.27.0-alpha.68
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-UMSBFCU7.js → chunk-BRNBYTW4.js} +37 -7
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/fixtures/privacy-runtime/linux-arm64/libggml-base.so +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-base.so.0 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-base.so.0.15.1 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-cpu.so +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-cpu.so.0 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml-cpu.so.0.15.1 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml.so +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml.so.0 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/libggml.so.0.15.1 +0 -0
- package/fixtures/privacy-runtime/linux-arm64/manifest.json +9 -9
- package/package.json +1 -1
|
@@ -15519,6 +15519,12 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15519
15519
|
}
|
|
15520
15520
|
async sendMessage(params) {
|
|
15521
15521
|
const preWsStartedAt = performance.now();
|
|
15522
|
+
const traceSendTiming = (phase) => {
|
|
15523
|
+
if (process.env.OPENMATES_TRACE_SEND_TIMING === "1") {
|
|
15524
|
+
console.error(`[chat send timing] phase=${phase} elapsed_ms=${Math.round(performance.now() - preWsStartedAt)}`);
|
|
15525
|
+
}
|
|
15526
|
+
};
|
|
15527
|
+
traceSendTiming("send_begin");
|
|
15522
15528
|
if (this.preparedSendSocket && !this.preparedSendSocket.opened) this.closePreparedSendSocket();
|
|
15523
15529
|
const teamId = this.resolveTeamContext({ teamId: params.teamId, personal: params.personal });
|
|
15524
15530
|
const teamSenderName = teamId ? await this.ownTeamSenderName(teamId) : "User";
|
|
@@ -15572,6 +15578,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15572
15578
|
let socketSnapshotResultRows = null;
|
|
15573
15579
|
let socketProjectCandidateRows = null;
|
|
15574
15580
|
let verifiedProjectCandidates = null;
|
|
15581
|
+
let deferredProjectDirectory = false;
|
|
15575
15582
|
let projectCandidatesReadyFromSendStartMs = null;
|
|
15576
15583
|
let socketMemoryReceipt = null;
|
|
15577
15584
|
const socketMemoryOptionsKey = () => JSON.stringify([
|
|
@@ -15602,8 +15609,12 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15602
15609
|
const combinedSupported = await memorySocket.ws.waitForServerCapability("personal_send_context_snapshot_v1");
|
|
15603
15610
|
const supported = combinedSupported || await memorySocket.ws.waitForServerCapability("personal_memory_snapshot_v1");
|
|
15604
15611
|
if (supported) {
|
|
15605
|
-
const
|
|
15612
|
+
const deferProjectDirectory = sdkMintedChatId && !teamId && !params.incognito && !params.projectId && shouldWaitForAi && memorySocket.ws.supportsServerCapability("personal_memory_snapshot_v1") && memorySocket.ws.supportsServerCapability("chat_turn_admit_v1") && memorySocket.ws.supportsServerCapability("chat_turn_context_v1");
|
|
15613
|
+
deferredProjectDirectory = deferProjectDirectory;
|
|
15614
|
+
traceSendTiming("snapshot_request");
|
|
15615
|
+
const combined = combinedSupported && !deferProjectDirectory ? await memorySocket.ws.requestPersonalSendContextSnapshot(randomUUID9()) : null;
|
|
15606
15616
|
const snapshot2 = combined?.personal_memories ?? await memorySocket.ws.requestPersonalMemorySnapshot(randomUUID9());
|
|
15617
|
+
traceSendTiming("snapshot_ready");
|
|
15607
15618
|
if (combined) {
|
|
15608
15619
|
socketProjectCandidateRows = combined.project_candidates;
|
|
15609
15620
|
verifiedProjectCandidates = await decodePersonalProjectCandidates(this, combined.project_candidates);
|
|
@@ -15611,6 +15622,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15611
15622
|
}
|
|
15612
15623
|
socketSnapshotResultRows = snapshot2.memories;
|
|
15613
15624
|
availableMemories = await this.listMemoriesUnshared({ personal: true }, snapshot2);
|
|
15625
|
+
traceSendTiming("memory_decrypt_ready");
|
|
15614
15626
|
if (!memorySocket.ws.isOpen() || JSON.stringify([
|
|
15615
15627
|
this.sendSocketOwnerKey(this.requireSession(), teamId),
|
|
15616
15628
|
authCookieFingerprint(this.http.getCookieMap())
|
|
@@ -15660,6 +15672,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15660
15672
|
const personalSendAuthHandoff = !teamId && !params.incognito ? snapshotAuthHandoff : null;
|
|
15661
15673
|
const memoryPrepMs = Math.round(performance.now() - memoryStartedAt);
|
|
15662
15674
|
const privacyStartedAt = performance.now();
|
|
15675
|
+
traceSendTiming("privacy_begin");
|
|
15663
15676
|
const savedPrivacyHistory = !params.incognito && params.chatId ? await this.getChatMessages(chatId, teamId ? { teamId } : { personal: true }) : null;
|
|
15664
15677
|
let piiMappings = [...savedPrivacyHistory?.messages.flatMap((message) => (message.piiMappings ?? []).map((mapping) => ({ ...mapping, type: mapping.type ?? "OTHER" }))) ?? [], ...params.piiMappings ?? []];
|
|
15665
15678
|
try {
|
|
@@ -15689,6 +15702,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15689
15702
|
throw error;
|
|
15690
15703
|
}
|
|
15691
15704
|
const privacyPrepMs = Math.round(performance.now() - privacyStartedAt);
|
|
15705
|
+
traceSendTiming("privacy_ready");
|
|
15692
15706
|
const preWsMs = Math.round(performance.now() - preWsStartedAt);
|
|
15693
15707
|
const contextSession = this.requireSession();
|
|
15694
15708
|
const {
|
|
@@ -15700,6 +15714,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15700
15714
|
activeTeamId: contextActiveTeamId
|
|
15701
15715
|
} = contextSession;
|
|
15702
15716
|
const contextScope = { teamId, personal: !teamId };
|
|
15717
|
+
const suppliedContext = deferredProjectDirectory ? { ...params.jevContext, project_focus_candidates: void 0 } : params.jevContext;
|
|
15703
15718
|
const contextStartedAt = Date.now();
|
|
15704
15719
|
let publishRouting;
|
|
15705
15720
|
const routingContext = new Promise((resolve20) => {
|
|
@@ -15715,7 +15730,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15715
15730
|
});
|
|
15716
15731
|
const publishProjectRoutingTimed = (context) => {
|
|
15717
15732
|
projectCandidatesReadyFromSendStartMs ??= Math.round(performance.now() - preWsStartedAt);
|
|
15718
|
-
publishProjectRouting(context);
|
|
15733
|
+
publishProjectRouting(deferredProjectDirectory ? { ...context, project_focus_candidates: context.project_focus_candidates?.filter((candidate) => candidate.auto_selection === true) } : context);
|
|
15719
15734
|
};
|
|
15720
15735
|
let recoveryMs = 0;
|
|
15721
15736
|
const contextOwnerIsCurrent = () => {
|
|
@@ -15723,7 +15738,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15723
15738
|
return Boolean(current2 && current2.apiUrl === contextApiUrl && current2.hashedEmail === contextHashedEmail && current2.sessionId === contextSessionId && current2.createdAt === contextSessionCreatedAt && current2.masterKeyExportedB64 === contextMasterKey && current2.activeTeamId === contextActiveTeamId);
|
|
15724
15739
|
};
|
|
15725
15740
|
const earlyContextAbort = new AbortController();
|
|
15726
|
-
const earlyContext = !params.incognito && !params.chatId && !params.projectId ? withHttpAbortSignal(earlyContextAbort.signal, () => prepareCliJevContext(this, chatId, contextScope,
|
|
15741
|
+
const earlyContext = !params.incognito && !params.chatId && !params.projectId ? withHttpAbortSignal(earlyContextAbort.signal, () => prepareCliJevContext(this, chatId, contextScope, suppliedContext, finalMessage, {
|
|
15727
15742
|
sdkMintedChatId,
|
|
15728
15743
|
onRouting: publishRouting,
|
|
15729
15744
|
verifiedProjectCandidates: verifiedProjectCandidates ?? void 0,
|
|
@@ -15830,6 +15845,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15830
15845
|
let terminalExpectedMessagesV = 1;
|
|
15831
15846
|
let savedTurnId = null;
|
|
15832
15847
|
if (!params.incognito) {
|
|
15848
|
+
traceSendTiming("key_begin");
|
|
15833
15849
|
const masterKey = this.getMasterKeyBytes();
|
|
15834
15850
|
const preparedKey = isNewChat && ownsPreparedId && this.preparedChatKey?.chatId === chatId && this.preparedChatOwnerCurrent(this.preparedChatKey.owner, teamId) ? this.preparedChatKey : null;
|
|
15835
15851
|
if (preparedKey) this.preparedChatKey = null;
|
|
@@ -15888,6 +15904,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
15888
15904
|
throw new Error(`Encrypted chat key not found for chat '${chatId}'. Sync and try again.`);
|
|
15889
15905
|
}
|
|
15890
15906
|
}
|
|
15907
|
+
traceSendTiming("key_ready");
|
|
15891
15908
|
}
|
|
15892
15909
|
let focusPersistence = Promise.resolve();
|
|
15893
15910
|
let focusPersistenceError = null;
|
|
@@ -16023,7 +16040,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16023
16040
|
messagePayload.client_context_request_id = contextRequestId;
|
|
16024
16041
|
}
|
|
16025
16042
|
pendingContext = (async () => {
|
|
16026
|
-
const prepared = earlyContext ? await earlyContext : { ok: true, value: await withHttpAbortSignal(earlyContextAbort.signal, () => prepareCliJevContext(this, chatId, contextScope,
|
|
16043
|
+
const prepared = earlyContext ? await earlyContext : { ok: true, value: await withHttpAbortSignal(earlyContextAbort.signal, () => prepareCliJevContext(this, chatId, contextScope, suppliedContext, finalMessage, {
|
|
16027
16044
|
sdkMintedChatId,
|
|
16028
16045
|
onRouting: publishRouting,
|
|
16029
16046
|
verifiedProjectCandidates: verifiedProjectCandidates ?? void 0,
|
|
@@ -16035,7 +16052,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16035
16052
|
if (process.env.OPENMATES_DEBUG === "1") {
|
|
16036
16053
|
console.error(`[chat preparation] pre_ws_ms=${preWsMs} memory_ms=${memoryPrepMs} privacy_ms=${privacyPrepMs} auth_ws_ms=${authSocketMs} recovery_ms=${recoveryMs} context_ms=${prepared.elapsedMs} project_candidates_ready_from_send_start_ms=${projectCandidatesReadyFromSendStartMs ?? "pending"}`);
|
|
16037
16054
|
}
|
|
16038
|
-
return prepared.value;
|
|
16055
|
+
return deferredProjectDirectory ? { ...prepared.value, project_focus_candidates: prepared.value.project_focus_candidates?.filter((candidate) => candidate.auto_selection === true) } : prepared.value;
|
|
16039
16056
|
})();
|
|
16040
16057
|
void pendingContext.catch(() => {
|
|
16041
16058
|
});
|
|
@@ -16159,6 +16176,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16159
16176
|
let admissionPayload = null;
|
|
16160
16177
|
let precollectedResponse = params.precollectResponse && params.incognito && shouldWaitForAi ? ws.collectAiResponse(messageId2, chatId, { onStream: params.onStream, timeoutMs: params.responseTimeoutMs }) : null;
|
|
16161
16178
|
if (!params.incognito && chatKeyBytes && encryptedChatKey) {
|
|
16179
|
+
traceSendTiming("preflight_begin");
|
|
16162
16180
|
const protocolVersion = 1;
|
|
16163
16181
|
const chatKeyVersion = 1;
|
|
16164
16182
|
const turnId = randomUUID9();
|
|
@@ -16295,6 +16313,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16295
16313
|
pendingContext = Promise.resolve(focusedContext);
|
|
16296
16314
|
}
|
|
16297
16315
|
admissionPayload = preflightPayload;
|
|
16316
|
+
traceSendTiming("preflight_ready");
|
|
16298
16317
|
} catch (error) {
|
|
16299
16318
|
ws.close();
|
|
16300
16319
|
throw error;
|
|
@@ -16360,10 +16379,12 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16360
16379
|
admissionContinuationPhase = "await_ack";
|
|
16361
16380
|
await consumeSocketMemoryReceipt();
|
|
16362
16381
|
await ws.sendAsync(useCombinedAdmission ? "chat_turn_admit" : "chat_turn_preflight", admissionPayload);
|
|
16382
|
+
traceSendTiming("admission_frame");
|
|
16363
16383
|
if (process.env.OPENMATES_DEBUG === "1") {
|
|
16364
16384
|
console.error(`[chat admission preparation] sdk_minted=${sdkMintedChatId} defer_recovery=${mayDeferRecovery} combined_admission=${useCombinedAdmission} caps_wait_ms=${capabilitiesWaitMs} key_wait_ms=${keyWaitMs} recovery_keypair_ms=${recoveryKeypairMs} encrypt_payload_ms=${encryptPayloadMs} socket_ready_to_frame_dispatch_ms=${Math.round(frameDispatchAt - socketReadyForSendAt)} frame_dispatch_from_send_start_ms=${Math.round(frameDispatchAt - preWsStartedAt)} wire_send_ms=${Math.round(performance.now() - frameDispatchAt)}`);
|
|
16365
16385
|
}
|
|
16366
16386
|
const ackPayload = (await admissionAck).payload;
|
|
16387
|
+
traceSendTiming("admission_ack");
|
|
16367
16388
|
admissionAckObserved = true;
|
|
16368
16389
|
if (typeof ackPayload.preflight_id !== "string" || !ackPayload.preflight_id) {
|
|
16369
16390
|
throw new Error("Encrypted chat admission acknowledgement omitted preflight_id.");
|
|
@@ -16405,7 +16426,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16405
16426
|
};
|
|
16406
16427
|
let routing;
|
|
16407
16428
|
try {
|
|
16408
|
-
routing = useSelectionDetailsV2 ? await projectRoutingContext : params.projectId ? await pendingContext : await Promise.race([routingContext, pendingContext]);
|
|
16429
|
+
routing = useSelectionDetailsV2 ? await projectRoutingContext : deferredProjectDirectory ? (await Promise.all([pendingContext, projectRoutingContext]))[0] : params.projectId ? await pendingContext : await Promise.race([routingContext, pendingContext]);
|
|
16409
16430
|
} catch (error) {
|
|
16410
16431
|
try {
|
|
16411
16432
|
await notifyContextFailure(useSelectionDetailsV2 ? "project_discovery_failed" : "context_preparation_failed");
|
|
@@ -16423,7 +16444,12 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16423
16444
|
let rejectedPhaseSeen = false;
|
|
16424
16445
|
const attemptedContextPhases = /* @__PURE__ */ new Set();
|
|
16425
16446
|
removeContextAckWatcher = ws.onMessageType("chat_turn_context_ack", (event) => {
|
|
16426
|
-
if (rejectedPhaseSeen || event.chat_id !== chatId || event.turn_id !== savedTurnId || event.message_id !== messageId2 || event.request_id !== contextRequestId || event.phase !== "routing" && event.phase !== "details" || !attemptedContextPhases.has(event.phase)
|
|
16447
|
+
if (rejectedPhaseSeen || event.chat_id !== chatId || event.turn_id !== savedTurnId || event.message_id !== messageId2 || event.request_id !== contextRequestId || event.phase !== "routing" && event.phase !== "details" || !attemptedContextPhases.has(event.phase)) return;
|
|
16448
|
+
if (event.status === "accepted" || event.status === "duplicate") {
|
|
16449
|
+
traceSendTiming(event.phase === "routing" ? "routing_ack" : "details_ack");
|
|
16450
|
+
return;
|
|
16451
|
+
}
|
|
16452
|
+
if (event.status !== "rejected") return;
|
|
16427
16453
|
rejectedPhaseSeen = true;
|
|
16428
16454
|
if (!contextOwnerIsCurrent()) {
|
|
16429
16455
|
rejectContextAck(new Error("Chat workspace changed while preparing context."));
|
|
@@ -16435,9 +16461,11 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16435
16461
|
});
|
|
16436
16462
|
});
|
|
16437
16463
|
const { project_focus_candidates, related_task_candidates, project_focus_catalog, accepted_plan_context } = routing;
|
|
16464
|
+
traceSendTiming("routing_prepared");
|
|
16438
16465
|
attemptedContextPhases.add("routing");
|
|
16439
16466
|
await ws.sendAsync("chat_turn_context_ready", { ...identity3, phase: "routing", context: useSelectionDetailsV2 ? { project_focus_candidates } : { project_focus_candidates, related_task_candidates, project_focus_catalog, accepted_plan_context } });
|
|
16440
16467
|
routingFrameSent = true;
|
|
16468
|
+
traceSendTiming("routing_frame");
|
|
16441
16469
|
admissionContinuationPhase = "await_details";
|
|
16442
16470
|
let context;
|
|
16443
16471
|
try {
|
|
@@ -16450,6 +16478,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16450
16478
|
throw error;
|
|
16451
16479
|
}
|
|
16452
16480
|
if (!contextOwnerIsCurrent()) throw new Error("Chat workspace changed while preparing context.");
|
|
16481
|
+
traceSendTiming("details_prepared");
|
|
16453
16482
|
attemptedContextPhases.add("details");
|
|
16454
16483
|
await ws.sendAsync("chat_turn_context_ready", { ...identity3, phase: "details", context: {
|
|
16455
16484
|
custom_memory_documents: context.custom_memory_documents ?? [],
|
|
@@ -16463,6 +16492,7 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
16463
16492
|
} : {}
|
|
16464
16493
|
} });
|
|
16465
16494
|
detailsFrameSent = true;
|
|
16495
|
+
traceSendTiming("details_frame");
|
|
16466
16496
|
}
|
|
16467
16497
|
admissionContinuationPhase = "await_confirmation";
|
|
16468
16498
|
} else {
|
package/dist/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
shouldRequireTrustedAccountGuard,
|
|
22
22
|
waitForSafeE2ETotpWindow,
|
|
23
23
|
waitForWorkflowRun
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-BRNBYTW4.js";
|
|
25
25
|
import "./chunk-IWKP55ZB.js";
|
|
26
26
|
import "./chunk-F2U6KIMR.js";
|
|
27
27
|
import "./chunk-YMVXTMTD.js";
|
package/dist/index.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -17,47 +17,47 @@
|
|
|
17
17
|
{
|
|
18
18
|
"name": "libggml-base.so",
|
|
19
19
|
"bytes": 1110088,
|
|
20
|
-
"sha256": "
|
|
20
|
+
"sha256": "3dbc8fa7f87cdf376436e8164dad352af883419126815b307acfe43f58170b27"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"name": "libggml-base.so.0",
|
|
24
24
|
"bytes": 1110088,
|
|
25
|
-
"sha256": "
|
|
25
|
+
"sha256": "3dbc8fa7f87cdf376436e8164dad352af883419126815b307acfe43f58170b27"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
"name": "libggml-base.so.0.15.1",
|
|
29
29
|
"bytes": 1110088,
|
|
30
|
-
"sha256": "
|
|
30
|
+
"sha256": "3dbc8fa7f87cdf376436e8164dad352af883419126815b307acfe43f58170b27"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
"name": "libggml-cpu.so",
|
|
34
34
|
"bytes": 869800,
|
|
35
|
-
"sha256": "
|
|
35
|
+
"sha256": "03423dbd3296a487876742f3a792d57ec80ee71f5d3ac9659c424afbe3394e01"
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
"name": "libggml-cpu.so.0",
|
|
39
39
|
"bytes": 869800,
|
|
40
|
-
"sha256": "
|
|
40
|
+
"sha256": "03423dbd3296a487876742f3a792d57ec80ee71f5d3ac9659c424afbe3394e01"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"name": "libggml-cpu.so.0.15.1",
|
|
44
44
|
"bytes": 869800,
|
|
45
|
-
"sha256": "
|
|
45
|
+
"sha256": "03423dbd3296a487876742f3a792d57ec80ee71f5d3ac9659c424afbe3394e01"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"name": "libggml.so",
|
|
49
49
|
"bytes": 1899104,
|
|
50
|
-
"sha256": "
|
|
50
|
+
"sha256": "28c405562b6a3b50deafd96c83ef48f774913eee1d12251db52e74d983bf8713"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"name": "libggml.so.0",
|
|
54
54
|
"bytes": 1899104,
|
|
55
|
-
"sha256": "
|
|
55
|
+
"sha256": "28c405562b6a3b50deafd96c83ef48f774913eee1d12251db52e74d983bf8713"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"name": "libggml.so.0.15.1",
|
|
59
59
|
"bytes": 1899104,
|
|
60
|
-
"sha256": "
|
|
60
|
+
"sha256": "28c405562b6a3b50deafd96c83ef48f774913eee1d12251db52e74d983bf8713"
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"name": "openmates-pii-worker",
|