memeloop 0.2.1 → 0.2.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/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/{chunk-K6P63KD4.js → chunk-HY3U3GLE.js} +16 -4
- package/dist/chunk-HY3U3GLE.js.map +1 -0
- 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/{fetchProvider-BhqRqi5-.d.ts → fetchProvider-B_vva3b3.d.ts} +26 -2
- package/dist/{fetchProvider-HJ_FkORN.d.cts → fetchProvider-Bz4CE3_R.d.cts} +26 -2
- package/dist/index.cjs +73 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/llm-providers.cjs +17 -6
- package/dist/llm-providers.cjs.map +1 -1
- package/dist/llm-providers.d.cts +2 -0
- package/dist/llm-providers.d.ts +2 -0
- package/dist/llm-providers.js +4 -4
- package/dist/llm-providers.js.map +1 -1
- package/dist/loop-api.cjs +16 -3
- package/dist/loop-api.cjs.map +1 -1
- package/dist/loop-api.d.cts +1 -1
- package/dist/loop-api.d.ts +1 -1
- package/dist/loop-api.js +4 -2
- package/dist/mobile.cjs +14 -3
- package/dist/mobile.cjs.map +1 -1
- package/dist/mobile.d.cts +1 -1
- package/dist/mobile.d.ts +1 -1
- package/dist/mobile.js +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-K6P63KD4.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,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as AgentLoopStep, f as AgentLoopInput, e as AgentLoopGenerator, c as AgentInstanceState, A as AgentFrameworkContext, n as LoopProfile, k as ILLMProvider } from './scriptDeploymentPipeline-B1q-UhrO.js';
|
|
2
|
-
import { LanguageModel } from 'ai';
|
|
2
|
+
import { JSONValue, LanguageModel } from 'ai';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AgentToolLoop runner — convenience API for driving a full loop turn.
|
|
@@ -58,6 +58,30 @@ declare function registerBuiltinLoopProfiles(): void;
|
|
|
58
58
|
* cohere, mistral, azure, bedrock, groq, ollama, openrouter, together, etc.
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
+
interface FetchLLMChatRequest {
|
|
62
|
+
messages?: Array<{
|
|
63
|
+
role: string;
|
|
64
|
+
content: string;
|
|
65
|
+
}>;
|
|
66
|
+
model?: string;
|
|
67
|
+
stream?: boolean;
|
|
68
|
+
/** Legacy OpenAI-compatible spelling retained for host adapters. */
|
|
69
|
+
max_tokens?: number;
|
|
70
|
+
/** AI SDK spelling. Takes precedence over max_tokens. */
|
|
71
|
+
maxOutputTokens?: number;
|
|
72
|
+
temperature?: number;
|
|
73
|
+
topP?: number;
|
|
74
|
+
providerOptions?: Record<string, Record<string, JSONValue>>;
|
|
75
|
+
system?: string;
|
|
76
|
+
abortSignal?: AbortSignal;
|
|
77
|
+
}
|
|
78
|
+
declare function resolveFetchLLMCallSettings(body: FetchLLMChatRequest): {
|
|
79
|
+
maxOutputTokens: number | undefined;
|
|
80
|
+
temperature: number | undefined;
|
|
81
|
+
topP: number | undefined;
|
|
82
|
+
providerOptions: Record<string, Record<string, JSONValue>> | undefined;
|
|
83
|
+
abortSignal: AbortSignal | undefined;
|
|
84
|
+
};
|
|
61
85
|
interface FetchLLMProviderConfig {
|
|
62
86
|
/** Display name. */
|
|
63
87
|
name: string;
|
|
@@ -88,4 +112,4 @@ interface FetchLLMProviderConfig {
|
|
|
88
112
|
*/
|
|
89
113
|
declare function createFetchLLMProvider(config: FetchLLMProviderConfig): ILLMProvider;
|
|
90
114
|
|
|
91
|
-
export { type
|
|
115
|
+
export { type FetchLLMChatRequest as F, type RunAgentToolLoopTurnCallbacks as R, type RunAgentToolLoopTurnResult as a, getBuiltinLoopProfiles as b, createFetchLLMProvider as c, runAgentToolLoopTurn as d, type FetchLLMProviderConfig as e, registerBuiltinLoopProfiles as f, getBuiltinLoopProfile as g, resolveFetchLLMCallSettings as h, resolveAgentToolLoopTerminalState as r };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as AgentLoopStep, f as AgentLoopInput, e as AgentLoopGenerator, c as AgentInstanceState, A as AgentFrameworkContext, n as LoopProfile, k as ILLMProvider } from './scriptDeploymentPipeline-XJzQyYys.cjs';
|
|
2
|
-
import { LanguageModel } from 'ai';
|
|
2
|
+
import { JSONValue, LanguageModel } from 'ai';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AgentToolLoop runner — convenience API for driving a full loop turn.
|
|
@@ -58,6 +58,30 @@ declare function registerBuiltinLoopProfiles(): void;
|
|
|
58
58
|
* cohere, mistral, azure, bedrock, groq, ollama, openrouter, together, etc.
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
+
interface FetchLLMChatRequest {
|
|
62
|
+
messages?: Array<{
|
|
63
|
+
role: string;
|
|
64
|
+
content: string;
|
|
65
|
+
}>;
|
|
66
|
+
model?: string;
|
|
67
|
+
stream?: boolean;
|
|
68
|
+
/** Legacy OpenAI-compatible spelling retained for host adapters. */
|
|
69
|
+
max_tokens?: number;
|
|
70
|
+
/** AI SDK spelling. Takes precedence over max_tokens. */
|
|
71
|
+
maxOutputTokens?: number;
|
|
72
|
+
temperature?: number;
|
|
73
|
+
topP?: number;
|
|
74
|
+
providerOptions?: Record<string, Record<string, JSONValue>>;
|
|
75
|
+
system?: string;
|
|
76
|
+
abortSignal?: AbortSignal;
|
|
77
|
+
}
|
|
78
|
+
declare function resolveFetchLLMCallSettings(body: FetchLLMChatRequest): {
|
|
79
|
+
maxOutputTokens: number | undefined;
|
|
80
|
+
temperature: number | undefined;
|
|
81
|
+
topP: number | undefined;
|
|
82
|
+
providerOptions: Record<string, Record<string, JSONValue>> | undefined;
|
|
83
|
+
abortSignal: AbortSignal | undefined;
|
|
84
|
+
};
|
|
61
85
|
interface FetchLLMProviderConfig {
|
|
62
86
|
/** Display name. */
|
|
63
87
|
name: string;
|
|
@@ -88,4 +112,4 @@ interface FetchLLMProviderConfig {
|
|
|
88
112
|
*/
|
|
89
113
|
declare function createFetchLLMProvider(config: FetchLLMProviderConfig): ILLMProvider;
|
|
90
114
|
|
|
91
|
-
export { type
|
|
115
|
+
export { type FetchLLMChatRequest as F, type RunAgentToolLoopTurnCallbacks as R, type RunAgentToolLoopTurnResult as a, getBuiltinLoopProfiles as b, createFetchLLMProvider as c, runAgentToolLoopTurn as d, type FetchLLMProviderConfig as e, registerBuiltinLoopProfiles as f, getBuiltinLoopProfile as g, resolveFetchLLMCallSettings as h, resolveAgentToolLoopTerminalState as r };
|
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,
|
|
@@ -26913,6 +26919,7 @@ __export(src_exports, {
|
|
|
26913
26919
|
resolveCategory: () => resolveCategory,
|
|
26914
26920
|
resolveExternalWorkloadResources: () => resolveExternalWorkloadResources,
|
|
26915
26921
|
resolveExternalWorkloadRuntime: () => resolveExternalWorkloadRuntime,
|
|
26922
|
+
resolveFetchLLMCallSettings: () => resolveFetchLLMCallSettings,
|
|
26916
26923
|
resolvePromptPluginMap: () => resolvePromptPluginMap,
|
|
26917
26924
|
resolveQuestionAnswer: () => resolveQuestionAnswer,
|
|
26918
26925
|
restoreArtifactManagementState: () => restoreArtifactManagementState,
|
|
@@ -28472,6 +28479,15 @@ var PromptPreviewController = class {
|
|
|
28472
28479
|
|
|
28473
28480
|
// src/llm/fetchProvider.ts
|
|
28474
28481
|
var import_ai = require("ai");
|
|
28482
|
+
function resolveFetchLLMCallSettings(body) {
|
|
28483
|
+
return {
|
|
28484
|
+
maxOutputTokens: body.maxOutputTokens ?? body.max_tokens,
|
|
28485
|
+
temperature: body.temperature,
|
|
28486
|
+
topP: body.topP,
|
|
28487
|
+
providerOptions: body.providerOptions,
|
|
28488
|
+
abortSignal: body.abortSignal
|
|
28489
|
+
};
|
|
28490
|
+
}
|
|
28475
28491
|
function createFetchLLMProvider(config) {
|
|
28476
28492
|
return {
|
|
28477
28493
|
name: config.name,
|
|
@@ -28496,9 +28512,7 @@ function createFetchLLMProvider(config) {
|
|
|
28496
28512
|
};
|
|
28497
28513
|
});
|
|
28498
28514
|
const system = body.system ?? (systemMessages.length > 0 ? systemMessages.join("\n\n") : void 0);
|
|
28499
|
-
const temperature = body
|
|
28500
|
-
const abortSignal = body.abortSignal;
|
|
28501
|
-
const maxOutputTokens = body.max_tokens;
|
|
28515
|
+
const { abortSignal, maxOutputTokens, providerOptions, temperature, topP } = resolveFetchLLMCallSettings(body);
|
|
28502
28516
|
if (body.stream !== false) {
|
|
28503
28517
|
let streamingError;
|
|
28504
28518
|
const result2 = (0, import_ai.streamText)({
|
|
@@ -28507,6 +28521,8 @@ function createFetchLLMProvider(config) {
|
|
|
28507
28521
|
messages,
|
|
28508
28522
|
maxOutputTokens,
|
|
28509
28523
|
temperature,
|
|
28524
|
+
topP,
|
|
28525
|
+
providerOptions,
|
|
28510
28526
|
abortSignal,
|
|
28511
28527
|
onError: ({ error: error2 }) => {
|
|
28512
28528
|
streamingError = error2;
|
|
@@ -28527,6 +28543,8 @@ function createFetchLLMProvider(config) {
|
|
|
28527
28543
|
messages,
|
|
28528
28544
|
maxOutputTokens,
|
|
28529
28545
|
temperature,
|
|
28546
|
+
topP,
|
|
28547
|
+
providerOptions,
|
|
28530
28548
|
abortSignal
|
|
28531
28549
|
});
|
|
28532
28550
|
return result.text;
|
|
@@ -29042,6 +29060,43 @@ var DeviceCloudConnectionCoordinator = class {
|
|
|
29042
29060
|
}
|
|
29043
29061
|
};
|
|
29044
29062
|
|
|
29063
|
+
// src/device-network/deviceGrantMessages.ts
|
|
29064
|
+
var DEVICE_BINDING_SIGNATURE_DOMAIN = "memeloop-device-binding-v2";
|
|
29065
|
+
var DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN = "memeloop-device-connection-grant-v2";
|
|
29066
|
+
var DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN = "memeloop-device-relay-admission-v2";
|
|
29067
|
+
function buildDeviceBindingMessage(input) {
|
|
29068
|
+
return new TextEncoder().encode([
|
|
29069
|
+
DEVICE_BINDING_SIGNATURE_DOMAIN,
|
|
29070
|
+
`accountId=${input.accountId}`,
|
|
29071
|
+
`peerId=${input.peerId}`,
|
|
29072
|
+
`publicKey=${input.publicKeyMultibase}`,
|
|
29073
|
+
`nonce=${input.nonce}`
|
|
29074
|
+
].join("\n"));
|
|
29075
|
+
}
|
|
29076
|
+
function buildDeviceConnectionGrantMessage(grant) {
|
|
29077
|
+
return new TextEncoder().encode([
|
|
29078
|
+
DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN,
|
|
29079
|
+
`issuer=${grant.issuer}`,
|
|
29080
|
+
`accountId=${grant.accountId}`,
|
|
29081
|
+
`subjectPeerId=${grant.subjectPeerId}`,
|
|
29082
|
+
`allowedPeerIds=${grant.allowedPeerIds.join(",")}`,
|
|
29083
|
+
`issuedAt=${grant.issuedAt}`,
|
|
29084
|
+
`expiresAt=${grant.expiresAt}`
|
|
29085
|
+
].join("\n"));
|
|
29086
|
+
}
|
|
29087
|
+
function buildDeviceRelayReservationTokenMessage(token) {
|
|
29088
|
+
return new TextEncoder().encode([
|
|
29089
|
+
DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN,
|
|
29090
|
+
`issuer=${token.issuer}`,
|
|
29091
|
+
`accountId=${token.accountId}`,
|
|
29092
|
+
`peerId=${token.peerId}`,
|
|
29093
|
+
`relayMultiaddrs=${token.relayMultiaddrs.join(",")}`,
|
|
29094
|
+
`bootstrapMultiaddrs=${token.bootstrapMultiaddrs.join(",")}`,
|
|
29095
|
+
`issuedAt=${token.issuedAt}`,
|
|
29096
|
+
`expiresAt=${token.expiresAt}`
|
|
29097
|
+
].join("\n"));
|
|
29098
|
+
}
|
|
29099
|
+
|
|
29045
29100
|
// src/device-network/deviceOrchestrationTransport.ts
|
|
29046
29101
|
init_errors();
|
|
29047
29102
|
|
|
@@ -29632,6 +29687,12 @@ var Libp2pDeviceSyncTransport = class {
|
|
|
29632
29687
|
async request(peerId, method, parameters) {
|
|
29633
29688
|
const grant = await this.grantProvider?.(peerId);
|
|
29634
29689
|
const stream = await this.deviceNetwork.openStream(peerId, "/memeloop/sync/2.0.0", grant);
|
|
29690
|
+
let aborted = false;
|
|
29691
|
+
const abort = async (error2) => {
|
|
29692
|
+
if (aborted) return;
|
|
29693
|
+
aborted = true;
|
|
29694
|
+
await stream.abort(error2);
|
|
29695
|
+
};
|
|
29635
29696
|
const request = {
|
|
29636
29697
|
type: LIBP2P_SYNC_REQUEST_TYPE,
|
|
29637
29698
|
id: crypto.randomUUID(),
|
|
@@ -29646,7 +29707,7 @@ var Libp2pDeviceSyncTransport = class {
|
|
|
29646
29707
|
maxPayloadBytes: 16 * 1024 * 1024,
|
|
29647
29708
|
idleTimeoutMs: 15e3,
|
|
29648
29709
|
totalTimeoutMs: 12e4,
|
|
29649
|
-
abort
|
|
29710
|
+
abort
|
|
29650
29711
|
})) {
|
|
29651
29712
|
if (response !== void 0) throw new Error("sync_response_multiple");
|
|
29652
29713
|
response = value;
|
|
@@ -29656,7 +29717,7 @@ var Libp2pDeviceSyncTransport = class {
|
|
|
29656
29717
|
if (!response.ok) throw new Error(response.error);
|
|
29657
29718
|
return response.result;
|
|
29658
29719
|
} catch (error2) {
|
|
29659
|
-
if (error2 instanceof JsonFrameError) await
|
|
29720
|
+
if (error2 instanceof JsonFrameError) await abort(error2);
|
|
29660
29721
|
throw error2;
|
|
29661
29722
|
} finally {
|
|
29662
29723
|
await stream.close().catch(() => void 0);
|
|
@@ -31681,9 +31742,12 @@ function getToolDefinition(toolId) {
|
|
|
31681
31742
|
CREDENTIAL_GRANT_KIND,
|
|
31682
31743
|
ChatSyncEngine,
|
|
31683
31744
|
DEFAULT_DESTINATION_POLICIES,
|
|
31745
|
+
DEVICE_BINDING_SIGNATURE_DOMAIN,
|
|
31746
|
+
DEVICE_CONNECTION_GRANT_SIGNATURE_DOMAIN,
|
|
31684
31747
|
DEVICE_ORCHESTRATION_PROTOCOL,
|
|
31685
31748
|
DEVICE_PAIRING_INVITE_PROTOCOL,
|
|
31686
31749
|
DEVICE_PAIRING_INVITE_TTL_MS,
|
|
31750
|
+
DEVICE_RELAY_ADMISSION_SIGNATURE_DOMAIN,
|
|
31687
31751
|
DRIVER_MANIFEST_API_VERSION,
|
|
31688
31752
|
DRIVER_MANIFEST_KIND,
|
|
31689
31753
|
DRIVER_REQUEST_API_VERSION,
|
|
@@ -31800,6 +31864,9 @@ function getToolDefinition(toolId) {
|
|
|
31800
31864
|
base64UrlEncode,
|
|
31801
31865
|
bindWorkerSession,
|
|
31802
31866
|
buildAgent,
|
|
31867
|
+
buildDeviceBindingMessage,
|
|
31868
|
+
buildDeviceConnectionGrantMessage,
|
|
31869
|
+
buildDeviceRelayReservationTokenMessage,
|
|
31803
31870
|
buildLegacyChatMessageParts,
|
|
31804
31871
|
buildMemeloopFileUri,
|
|
31805
31872
|
buildMemeloopUri,
|
|
@@ -32137,6 +32204,7 @@ function getToolDefinition(toolId) {
|
|
|
32137
32204
|
resolveCategory,
|
|
32138
32205
|
resolveExternalWorkloadResources,
|
|
32139
32206
|
resolveExternalWorkloadRuntime,
|
|
32207
|
+
resolveFetchLLMCallSettings,
|
|
32140
32208
|
resolvePromptPluginMap,
|
|
32141
32209
|
resolveQuestionAnswer,
|
|
32142
32210
|
restoreArtifactManagementState,
|