memeloop 0.2.1 → 0.2.2
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/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/chunk-JRCEXHTP.js +1 -0
- package/dist/{chunk-E5R24U4I.js → chunk-KXVZQLJL.js} +52 -3
- package/dist/chunk-KXVZQLJL.js.map +1 -0
- package/dist/device-network-portable.cjs +57 -2
- package/dist/device-network-portable.cjs.map +1 -1
- package/dist/device-network-portable.d.cts +2 -2
- package/dist/device-network-portable.d.ts +2 -2
- package/dist/device-network-portable.js +14 -2
- package/dist/device-network.cjs +57 -2
- package/dist/device-network.cjs.map +1 -1
- package/dist/device-network.d.cts +1 -1
- package/dist/device-network.d.ts +1 -1
- package/dist/device-network.js +14 -2
- package/dist/index.cjs +57 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/{pairingInvite-DENOiqa0.d.cts → pairingInvite-C12n-7Ak.d.cts} +14 -2
- package/dist/{pairingInvite-DZy77i0p.d.ts → pairingInvite-CPQkuhLQ.d.ts} +14 -2
- package/package.json +1 -1
- package/dist/chunk-E5R24U4I.js.map +0 -1
- package/dist/chunk-MXRXYGWW.js +0 -1
- /package/dist/{chunk-MXRXYGWW.js.map → chunk-JRCEXHTP.js.map} +0 -0
package/dist/device-network.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AttachmentBlobWire, C as CreateDevicePairingInviteOptions, D as
|
|
1
|
+
export { A as AttachmentBlobWire, C as CreateDevicePairingInviteOptions, D as DEVICE_BINDING_SIGNATURE_DOMAIN, a as DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN, b as DEVICE_ORCHESTRATION_PROTOCOL, c as DEVICE_PAIRING_INVITE_PROTOCOL, d as DEVICE_PAIRING_INVITE_TTL_MS, e as DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN, f as DeviceCloudComponentStatus, g as DeviceCloudConnectionAdapter, h as DeviceCloudConnectionComponent, i as DeviceCloudConnectionCoordinator, j as DeviceCloudConnectionCoordinatorOptions, k as DeviceCloudConnectionSnapshot, l as DeviceCloudConnectionStatus, m as DeviceCloudStepResult, n as DeviceOrchestrationStreamHandler, o as DeviceOrchestrationStreamHandlerInput, p as DeviceOrchestrationStreamHandlerOptions, q as DeviceOrchestrationTransportOptions, r as DevicePairingInvite, s as DevicePairingInviteIdentityVerifier, t as DevicePairingInviteIdentityVerifierInput, u as DevicePairingInviteUnsignedPayload, v as DeviceSyncStateStore, J as JsonFrameError, w as JsonFrameErrorCode, x as JsonFrameReaderOptions, L as LIBP2P_RPC_REQUEST_TYPE, y as LIBP2P_RPC_RESPONSE_TYPE, z as LIBP2P_SYNC_REQUEST_TYPE, B as LIBP2P_SYNC_RESPONSE_TYPE, E as Libp2pDeviceSyncTransport, F as Libp2pDeviceSyncTransportOptions, G as Libp2pRpcRequest, H as Libp2pRpcResponse, I as Libp2pSyncMethod, K as Libp2pSyncRequest, M as Libp2pSyncResponse, N as LocalTrustDeviceAuthorizer, O as LocalTrustDeviceAuthorizerOptions, P as MemoryDeviceSyncStateStore, Q as ParseDevicePairingInviteOptions, R as RemoteOrchestrationHandler, S as attachmentBlobFromWire, T as buildDeviceBindingMessage, U as buildDeviceConnectionGrantMessage, V as buildDeviceRelayReservationTokenMessage, W as canonicalDevicePairingInviteBytes, X as createDeviceOrchestrationStreamHandler, Y as createDeviceOrchestrationTransport, Z as createDevicePairingInvite, _ as createJsonFrameReader, $ as encodeDevicePairingInvite, a0 as encodeJsonFrame, a1 as encodeJsonFrames, a2 as isLibp2pRpcRequest, a3 as isLibp2pRpcResponse, a4 as isLibp2pSyncRequest, a5 as isLibp2pSyncResponse, a6 as parseDevicePairingInvite } from './pairingInvite-CPQkuhLQ.js';
|
|
2
2
|
export { A as AgentExecutionLocation, a as AgentExecutionState, b as AttachmentBlob, C as CloudDeviceClient, c as CloudDeviceRecord, d as ConversationExecutionPlacement, D as Device, e as DeviceAccountBindingRequest, f as DeviceAuthorizer, g as DeviceCapabilities, h as DeviceConnectionGrant, i as DeviceConnectionGrantVerificationInput, j as DeviceNetworkListenOptions, k as DeviceNetworkPath, l as DeviceNetworkService, m as DevicePlatform, n as DeviceProtocolDirection, o as DeviceReachability, p as DeviceReachabilityState, q as DeviceRelayReservationToken, r as DeviceRelayReservationTokenVerificationInput, s as DeviceRpcHandler, t as DeviceRpcHandlerInput, u as DeviceSyncTransport, v as DeviceTrustMode, w as DeviceTrustStore, E as ExchangeVersionVectorResult, L as LocalDeviceIdentity, x as LocalPairingRequestOptions, M as MemeLoopDuplexStream, y as MemeLoopProtocol, P as PairingSession, z as PairingSessionDirection, B as PairingSessionStatus, S as SyncResult, T as TrustedDeviceRecord } from './types-CcFFIk8W.js';
|
|
3
3
|
export { ChatSyncEngine, ChatSyncEngineOptions, ChatSyncPeer, PeerNodeSyncAdapter, PeerNodeTransport, decodeAttachmentBlobRpc } from './device-network-portable.js';
|
|
4
4
|
export { C as ConversationMeta, a as ConversationMetadataPage, I as IAgentStorage, V as VersionRange, b as VersionVector, c as computeMissingVersionRanges, i as isConversationMeta } from './interface-3C3eG8Hn.js';
|
package/dist/device-network.js
CHANGED
|
@@ -2,12 +2,15 @@ import {
|
|
|
2
2
|
MemoryDeviceNetworkService,
|
|
3
3
|
syncCloudDevices
|
|
4
4
|
} from "./chunk-EPHRIRAL.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-JRCEXHTP.js";
|
|
6
6
|
import {
|
|
7
7
|
ChatSyncEngine,
|
|
8
|
+
DEVICE_BINDING_SIGNATURE_DOMAIN,
|
|
9
|
+
DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN,
|
|
8
10
|
DEVICE_ORCHESTRATION_PROTOCOL,
|
|
9
11
|
DEVICE_PAIRING_INVITE_PROTOCOL,
|
|
10
12
|
DEVICE_PAIRING_INVITE_TTL_MS,
|
|
13
|
+
DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN,
|
|
11
14
|
DeviceCloudConnectionCoordinator,
|
|
12
15
|
JsonFrameError,
|
|
13
16
|
LIBP2P_RPC_REQUEST_TYPE,
|
|
@@ -19,6 +22,9 @@ import {
|
|
|
19
22
|
MemoryDeviceSyncStateStore,
|
|
20
23
|
PeerNodeSyncAdapter,
|
|
21
24
|
attachmentBlobFromWire,
|
|
25
|
+
buildDeviceBindingMessage,
|
|
26
|
+
buildDeviceConnectionGrantMessage,
|
|
27
|
+
buildDeviceRelayReservationTokenMessage,
|
|
22
28
|
canonicalDevicePairingInviteBytes,
|
|
23
29
|
computeMissingVersionRanges,
|
|
24
30
|
createDeviceOrchestrationStreamHandler,
|
|
@@ -35,13 +41,16 @@ import {
|
|
|
35
41
|
isLibp2pSyncRequest,
|
|
36
42
|
isLibp2pSyncResponse,
|
|
37
43
|
parseDevicePairingInvite
|
|
38
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-KXVZQLJL.js";
|
|
39
45
|
import "./chunk-FWSY5HOA.js";
|
|
40
46
|
export {
|
|
41
47
|
ChatSyncEngine,
|
|
48
|
+
DEVICE_BINDING_SIGNATURE_DOMAIN,
|
|
49
|
+
DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN,
|
|
42
50
|
DEVICE_ORCHESTRATION_PROTOCOL,
|
|
43
51
|
DEVICE_PAIRING_INVITE_PROTOCOL,
|
|
44
52
|
DEVICE_PAIRING_INVITE_TTL_MS,
|
|
53
|
+
DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN,
|
|
45
54
|
DeviceCloudConnectionCoordinator,
|
|
46
55
|
JsonFrameError,
|
|
47
56
|
LIBP2P_RPC_REQUEST_TYPE,
|
|
@@ -54,6 +63,9 @@ export {
|
|
|
54
63
|
MemoryDeviceSyncStateStore,
|
|
55
64
|
PeerNodeSyncAdapter,
|
|
56
65
|
attachmentBlobFromWire,
|
|
66
|
+
buildDeviceBindingMessage,
|
|
67
|
+
buildDeviceConnectionGrantMessage,
|
|
68
|
+
buildDeviceRelayReservationTokenMessage,
|
|
57
69
|
canonicalDevicePairingInviteBytes,
|
|
58
70
|
computeMissingVersionRanges,
|
|
59
71
|
createDeviceOrchestrationStreamHandler,
|
package/dist/index.cjs
CHANGED
|
@@ -26457,9 +26457,12 @@ __export(src_exports, {
|
|
|
26457
26457
|
CREDENTIAL_GRANT_KIND: () => CREDENTIAL_GRANT_KIND,
|
|
26458
26458
|
ChatSyncEngine: () => ChatSyncEngine,
|
|
26459
26459
|
DEFAULT_DESTINATION_POLICIES: () => DEFAULT_DESTINATION_POLICIES,
|
|
26460
|
+
DEVICE_BINDING_SIGNATURE_DOMAIN: () => DEVICE_BINDING_SIGNATURE_DOMAIN,
|
|
26461
|
+
DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN: () => DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN,
|
|
26460
26462
|
DEVICE_ORCHESTRATION_PROTOCOL: () => DEVICE_ORCHESTRATION_PROTOCOL,
|
|
26461
26463
|
DEVICE_PAIRING_INVITE_PROTOCOL: () => DEVICE_PAIRING_INVITE_PROTOCOL,
|
|
26462
26464
|
DEVICE_PAIRING_INVITE_TTL_MS: () => DEVICE_PAIRING_INVITE_TTL_MS,
|
|
26465
|
+
DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN: () => DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN,
|
|
26463
26466
|
DRIVER_MANIFEST_API_VERSION: () => DRIVER_MANIFEST_API_VERSION,
|
|
26464
26467
|
DRIVER_MANIFEST_KIND: () => DRIVER_MANIFEST_KIND,
|
|
26465
26468
|
DRIVER_REQUEST_API_VERSION: () => DRIVER_REQUEST_API_VERSION,
|
|
@@ -26576,6 +26579,9 @@ __export(src_exports, {
|
|
|
26576
26579
|
base64UrlEncode: () => base64UrlEncode,
|
|
26577
26580
|
bindWorkerSession: () => bindWorkerSession,
|
|
26578
26581
|
buildAgent: () => buildAgent,
|
|
26582
|
+
buildDeviceBindingMessage: () => buildDeviceBindingMessage,
|
|
26583
|
+
buildDeviceConnectionGrantMessage: () => buildDeviceConnectionGrantMessage,
|
|
26584
|
+
buildDeviceRelayReservationTokenMessage: () => buildDeviceRelayReservationTokenMessage,
|
|
26579
26585
|
buildLegacyChatMessageParts: () => buildLegacyChatMessageParts,
|
|
26580
26586
|
buildMemeloopFileUri: () => buildMemeloopFileUri,
|
|
26581
26587
|
buildMemeloopUri: () => buildMemeloopUri,
|
|
@@ -29042,6 +29048,43 @@ var DeviceCloudConnectionCoordinator = class {
|
|
|
29042
29048
|
}
|
|
29043
29049
|
};
|
|
29044
29050
|
|
|
29051
|
+
// src/device-network/deviceGrantMessages.ts
|
|
29052
|
+
var DEVICE_BINDING_SIGNATURE_DOMAIN = "memeloop-device-binding-v2";
|
|
29053
|
+
var DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN = "memeloop-device-connection-grant-v2";
|
|
29054
|
+
var DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN = "memeloop-device-relay-admission-v2";
|
|
29055
|
+
function buildDeviceBindingMessage(input) {
|
|
29056
|
+
return new TextEncoder().encode([
|
|
29057
|
+
DEVICE_BINDING_SIGNATURE_DOMAIN,
|
|
29058
|
+
`accountId=${input.accountId}`,
|
|
29059
|
+
`peerId=${input.peerId}`,
|
|
29060
|
+
`publicKey=${input.publicKeyMultibase}`,
|
|
29061
|
+
`nonce=${input.nonce}`
|
|
29062
|
+
].join("\n"));
|
|
29063
|
+
}
|
|
29064
|
+
function buildDeviceConnectionGrantMessage(grant) {
|
|
29065
|
+
return new TextEncoder().encode([
|
|
29066
|
+
DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN,
|
|
29067
|
+
`issuer=${grant.issuer}`,
|
|
29068
|
+
`accountId=${grant.accountId}`,
|
|
29069
|
+
`subjectPeerId=${grant.subjectPeerId}`,
|
|
29070
|
+
`allowedPeerIds=${grant.allowedPeerIds.join(",")}`,
|
|
29071
|
+
`issuedAt=${grant.issuedAt}`,
|
|
29072
|
+
`expiresAt=${grant.expiresAt}`
|
|
29073
|
+
].join("\n"));
|
|
29074
|
+
}
|
|
29075
|
+
function buildDeviceRelayReservationTokenMessage(token) {
|
|
29076
|
+
return new TextEncoder().encode([
|
|
29077
|
+
DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN,
|
|
29078
|
+
`issuer=${token.issuer}`,
|
|
29079
|
+
`accountId=${token.accountId}`,
|
|
29080
|
+
`peerId=${token.peerId}`,
|
|
29081
|
+
`relayMultiaddrs=${token.relayMultiaddrs.join(",")}`,
|
|
29082
|
+
`bootstrapMultiaddrs=${token.bootstrapMultiaddrs.join(",")}`,
|
|
29083
|
+
`issuedAt=${token.issuedAt}`,
|
|
29084
|
+
`expiresAt=${token.expiresAt}`
|
|
29085
|
+
].join("\n"));
|
|
29086
|
+
}
|
|
29087
|
+
|
|
29045
29088
|
// src/device-network/deviceOrchestrationTransport.ts
|
|
29046
29089
|
init_errors();
|
|
29047
29090
|
|
|
@@ -29632,6 +29675,12 @@ var Libp2pDeviceSyncTransport = class {
|
|
|
29632
29675
|
async request(peerId, method, parameters) {
|
|
29633
29676
|
const grant = await this.grantProvider?.(peerId);
|
|
29634
29677
|
const stream = await this.deviceNetwork.openStream(peerId, "/memeloop/sync/2.0.0", grant);
|
|
29678
|
+
let aborted = false;
|
|
29679
|
+
const abort = async (error2) => {
|
|
29680
|
+
if (aborted) return;
|
|
29681
|
+
aborted = true;
|
|
29682
|
+
await stream.abort(error2);
|
|
29683
|
+
};
|
|
29635
29684
|
const request = {
|
|
29636
29685
|
type: LIBP2P_SYNC_REQUEST_TYPE,
|
|
29637
29686
|
id: crypto.randomUUID(),
|
|
@@ -29646,7 +29695,7 @@ var Libp2pDeviceSyncTransport = class {
|
|
|
29646
29695
|
maxPayloadBytes: 16 * 1024 * 1024,
|
|
29647
29696
|
idleTimeoutMs: 15e3,
|
|
29648
29697
|
totalTimeoutMs: 12e4,
|
|
29649
|
-
abort
|
|
29698
|
+
abort
|
|
29650
29699
|
})) {
|
|
29651
29700
|
if (response !== void 0) throw new Error("sync_response_multiple");
|
|
29652
29701
|
response = value;
|
|
@@ -29656,7 +29705,7 @@ var Libp2pDeviceSyncTransport = class {
|
|
|
29656
29705
|
if (!response.ok) throw new Error(response.error);
|
|
29657
29706
|
return response.result;
|
|
29658
29707
|
} catch (error2) {
|
|
29659
|
-
if (error2 instanceof JsonFrameError) await
|
|
29708
|
+
if (error2 instanceof JsonFrameError) await abort(error2);
|
|
29660
29709
|
throw error2;
|
|
29661
29710
|
} finally {
|
|
29662
29711
|
await stream.close().catch(() => void 0);
|
|
@@ -31681,9 +31730,12 @@ function getToolDefinition(toolId) {
|
|
|
31681
31730
|
CREDENTIAL_GRANT_KIND,
|
|
31682
31731
|
ChatSyncEngine,
|
|
31683
31732
|
DEFAULT_DESTINATION_POLICIES,
|
|
31733
|
+
DEVICE_BINDING_SIGNATURE_DOMAIN,
|
|
31734
|
+
DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN,
|
|
31684
31735
|
DEVICE_ORCHESTRATION_PROTOCOL,
|
|
31685
31736
|
DEVICE_PAIRING_INVITE_PROTOCOL,
|
|
31686
31737
|
DEVICE_PAIRING_INVITE_TTL_MS,
|
|
31738
|
+
DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN,
|
|
31687
31739
|
DRIVER_MANIFEST_API_VERSION,
|
|
31688
31740
|
DRIVER_MANIFEST_KIND,
|
|
31689
31741
|
DRIVER_REQUEST_API_VERSION,
|
|
@@ -31800,6 +31852,9 @@ function getToolDefinition(toolId) {
|
|
|
31800
31852
|
base64UrlEncode,
|
|
31801
31853
|
bindWorkerSession,
|
|
31802
31854
|
buildAgent,
|
|
31855
|
+
buildDeviceBindingMessage,
|
|
31856
|
+
buildDeviceConnectionGrantMessage,
|
|
31857
|
+
buildDeviceRelayReservationTokenMessage,
|
|
31803
31858
|
buildLegacyChatMessageParts,
|
|
31804
31859
|
buildMemeloopFileUri,
|
|
31805
31860
|
buildMemeloopUri,
|