@moxt-ai/mobius 0.0.59 → 0.0.60
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/agent-catalog/publish-agent-catalog.d.ts.map +1 -1
- package/dist/agent-catalog/publish-agent-catalog.js +36 -3
- package/dist/agent-catalog/publish-agent-catalog.js.map +1 -1
- package/dist/artifacts/local-file-streamer.d.ts +2 -2
- package/dist/artifacts/local-file-streamer.d.ts.map +1 -1
- package/dist/artifacts/local-file-streamer.js +7 -7
- package/dist/artifacts/local-file-streamer.js.map +1 -1
- package/dist/cli.js +583 -328
- package/dist/cli.js.map +4 -4
- package/dist/index.js +582 -327
- package/dist/index.js.map +4 -4
- package/dist/relay-connection/liveness.d.ts +2 -2
- package/dist/relay-connection/liveness.d.ts.map +1 -1
- package/dist/relay-connection/liveness.js +3 -3
- package/dist/relay-connection/liveness.js.map +1 -1
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +114 -112
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +591 -336
- package/dist/runtime.js.map +4 -4
- package/package.json +1 -1
package/dist/runtime.js
CHANGED
|
@@ -23103,39 +23103,65 @@ var decodePromptResourcesValue = (value) => decodeValue(value, external_exports.
|
|
|
23103
23103
|
var decodeSessionConfigurationSelections = (value) => decodeValue(value, sessionConfigurationSelectionsSchema);
|
|
23104
23104
|
var encode3 = (message, schema) => JSON.stringify(decodeValue(message, schema));
|
|
23105
23105
|
var decodeAgentSettingsDiscoverCommand = (encoded) => decode3(encoded, agentSettingsDiscoverCommandSchema);
|
|
23106
|
+
var encodeAgentSettingsDiscoverCommand = (message) => encode3(message, agentSettingsDiscoverCommandSchema);
|
|
23107
|
+
var decodeAgentSettingsDiscoveredEvent = (encoded) => decode3(encoded, agentSettingsDiscoveredEventSchema);
|
|
23106
23108
|
var encodeAgentSettingsDiscoveredEvent = (message) => encode3(message, agentSettingsDiscoveredEventSchema);
|
|
23109
|
+
var decodeAgentSettingsDiscoveryFailedEvent = (encoded) => decode3(encoded, agentSettingsDiscoveryFailedEventSchema);
|
|
23107
23110
|
var encodeAgentSettingsDiscoveryFailedEvent = (message) => encode3(message, agentSettingsDiscoveryFailedEventSchema);
|
|
23108
23111
|
var decodeAgentCatalogRefreshCommand = (encoded) => decode3(encoded, agentCatalogRefreshCommandSchema);
|
|
23112
|
+
var encodeAgentCatalogRefreshCommand = (message) => encode3(message, agentCatalogRefreshCommandSchema);
|
|
23113
|
+
var decodeAgentCatalogRefreshedEvent = (encoded) => decode3(encoded, agentCatalogRefreshedEventSchema);
|
|
23109
23114
|
var encodeAgentCatalogRefreshedEvent = (message) => encode3(message, agentCatalogRefreshedEventSchema);
|
|
23115
|
+
var decodeAgentCatalogRefreshFailedEvent = (encoded) => decode3(encoded, agentCatalogRefreshFailedEventSchema);
|
|
23110
23116
|
var encodeAgentCatalogRefreshFailedEvent = (message) => encode3(message, agentCatalogRefreshFailedEventSchema);
|
|
23111
23117
|
var decodeFileReadCommand = (encoded) => decode3(encoded, fileReadCommandSchema);
|
|
23118
|
+
var encodeFileReadCommand = (message) => encode3(message, fileReadCommandSchema);
|
|
23119
|
+
var decodeFileBeginEvent = (encoded) => decode3(encoded, fileBeginEventSchema);
|
|
23112
23120
|
var encodeFileBeginEvent = (message) => encode3(message, fileBeginEventSchema);
|
|
23121
|
+
var decodeFileChunkEvent = (encoded) => decode3(encoded, fileChunkEventSchema);
|
|
23113
23122
|
var encodeFileChunkEvent = (message) => encode3(message, fileChunkEventSchema);
|
|
23123
|
+
var decodeFileEndEvent = (encoded) => decode3(encoded, fileEndEventSchema);
|
|
23114
23124
|
var encodeFileEndEvent = (message) => encode3(message, fileEndEventSchema);
|
|
23125
|
+
var decodeFileFailedEvent = (encoded) => decode3(encoded, fileFailedEventSchema);
|
|
23115
23126
|
var encodeFileFailedEvent = (message) => encode3(message, fileFailedEventSchema);
|
|
23116
23127
|
var decodeWorkspaceListCommand = (encoded) => decode3(encoded, workspaceListCommandSchema);
|
|
23128
|
+
var encodeWorkspaceListCommand = (message) => encode3(message, workspaceListCommandSchema);
|
|
23129
|
+
var decodeWorkspaceEntriesEvent = (encoded) => decode3(encoded, workspaceEntriesEventSchema);
|
|
23117
23130
|
var encodeWorkspaceEntriesEvent = (message) => encode3(message, workspaceEntriesEventSchema);
|
|
23118
23131
|
var decodeSessionPrepareCommand = (encoded) => decode3(encoded, sessionPrepareCommandSchema);
|
|
23132
|
+
var encodeSessionPrepareCommand = (message) => encode3(message, sessionPrepareCommandSchema);
|
|
23133
|
+
var decodeSessionReadyEvent = (encoded) => decode3(encoded, sessionReadyEventSchema);
|
|
23119
23134
|
var encodeSessionReadyEvent = (message) => encode3(message, sessionReadyEventSchema);
|
|
23120
23135
|
var decodeSessionConfigureCommand = (encoded) => decode3(encoded, sessionConfigureCommandSchema);
|
|
23121
|
-
var
|
|
23122
|
-
var
|
|
23123
|
-
var
|
|
23124
|
-
var
|
|
23125
|
-
var
|
|
23136
|
+
var encodeSessionConfigureCommand = (message) => encode3(message, sessionConfigureCommandSchema);
|
|
23137
|
+
var decodeSessionConfigUpdatedEvent = (encoded) => decode3(encoded, sessionConfigUpdatedEventSchema);
|
|
23138
|
+
var decodeSessionUsageUpdatedEvent = (encoded) => decode3(encoded, sessionUsageUpdatedEventSchema);
|
|
23139
|
+
var decodeSessionCommandsUpdatedEvent = (encoded) => decode3(encoded, sessionCommandsUpdatedEventSchema);
|
|
23140
|
+
var decodeSessionInfoUpdatedEvent = (encoded) => decode3(encoded, sessionInfoUpdatedEventSchema);
|
|
23141
|
+
var decodeSessionPermissionRequestedEvent = (encoded) => decode3(encoded, sessionPermissionRequestedEventSchema);
|
|
23126
23142
|
var decodeSessionPermissionRespondCommand = (encoded) => decode3(encoded, sessionPermissionRespondCommandSchema);
|
|
23127
|
-
var
|
|
23128
|
-
var
|
|
23143
|
+
var encodeSessionPermissionRespondCommand = (message) => encode3(message, sessionPermissionRespondCommandSchema);
|
|
23144
|
+
var decodeSessionPermissionResolvedEvent = (encoded) => decode3(encoded, sessionPermissionResolvedEventSchema);
|
|
23145
|
+
var decodeSessionElicitationRequestedEvent = (encoded) => decode3(encoded, sessionElicitationRequestedEventSchema);
|
|
23129
23146
|
var decodeSessionElicitationRespondCommand = (encoded) => decode3(encoded, sessionElicitationRespondCommandSchema);
|
|
23130
|
-
var
|
|
23147
|
+
var encodeSessionElicitationRespondCommand = (message) => encode3(message, sessionElicitationRespondCommandSchema);
|
|
23148
|
+
var decodeSessionElicitationResolvedEvent = (encoded) => decode3(encoded, sessionElicitationResolvedEventSchema);
|
|
23149
|
+
var decodeSessionOperationFailedEvent = (encoded) => decode3(encoded, sessionOperationFailedEventSchema);
|
|
23131
23150
|
var encodeSessionOperationFailedEvent = (message) => encode3(message, sessionOperationFailedEventSchema);
|
|
23132
|
-
var
|
|
23151
|
+
var decodeAgentContentEvent = (encoded) => decode3(encoded, agentContentEventSchema);
|
|
23133
23152
|
var decodeAgentInstallRequestCommand = (encoded) => decode3(encoded, agentInstallRequestCommandSchema);
|
|
23153
|
+
var encodeAgentInstallRequestCommand = (message) => encode3(message, agentInstallRequestCommandSchema);
|
|
23134
23154
|
var decodeAgentInstallCancelCommand = (encoded) => decode3(encoded, agentInstallCancelCommandSchema);
|
|
23155
|
+
var encodeAgentInstallCancelCommand = (message) => encode3(message, agentInstallCancelCommandSchema);
|
|
23156
|
+
var decodeAgentInstallStartedEvent = (encoded) => decode3(encoded, agentInstallStartedEventSchema);
|
|
23135
23157
|
var encodeAgentInstallStartedEvent = (message) => encode3(message, agentInstallStartedEventSchema);
|
|
23158
|
+
var decodeAgentInstallProgressEvent = (encoded) => decode3(encoded, agentInstallProgressEventSchema);
|
|
23136
23159
|
var encodeAgentInstallProgressEvent = (message) => encode3(message, agentInstallProgressEventSchema);
|
|
23160
|
+
var decodeAgentInstallCompletedEvent = (encoded) => decode3(encoded, agentInstallCompletedEventSchema);
|
|
23137
23161
|
var encodeAgentInstallCompletedEvent = (message) => encode3(message, agentInstallCompletedEventSchema);
|
|
23162
|
+
var decodeAgentInstallFailedEvent = (encoded) => decode3(encoded, agentInstallFailedEventSchema);
|
|
23138
23163
|
var encodeAgentInstallFailedEvent = (message) => encode3(message, agentInstallFailedEventSchema);
|
|
23164
|
+
var decodeAgentInstallCancelledEvent = (encoded) => decode3(encoded, agentInstallCancelledEventSchema);
|
|
23139
23165
|
var encodeAgentInstallCancelledEvent = (message) => encode3(message, agentInstallCancelledEventSchema);
|
|
23140
23166
|
|
|
23141
23167
|
// ../protocol/src/messages.ts
|
|
@@ -23570,49 +23596,29 @@ function decodeSessionFailedEvent(encoded) {
|
|
|
23570
23596
|
sessionId: readIdentifier(value, "sessionId")
|
|
23571
23597
|
};
|
|
23572
23598
|
}
|
|
23573
|
-
function
|
|
23574
|
-
return JSON.stringify(
|
|
23599
|
+
function encodeSessionPromptCommand(message) {
|
|
23600
|
+
return JSON.stringify(decodeSessionPromptCommand(JSON.stringify(message)));
|
|
23575
23601
|
}
|
|
23576
|
-
function
|
|
23577
|
-
return JSON.stringify(
|
|
23602
|
+
function encodeSessionCancelCommand(message) {
|
|
23603
|
+
return JSON.stringify(decodeSessionCancelCommand(JSON.stringify(message)));
|
|
23578
23604
|
}
|
|
23579
|
-
function
|
|
23580
|
-
return JSON.stringify(
|
|
23605
|
+
function encodeRuntimeLivenessReadyEvent(message) {
|
|
23606
|
+
return JSON.stringify(decodeRuntimeLivenessReadyEvent(JSON.stringify(message)));
|
|
23581
23607
|
}
|
|
23582
|
-
function
|
|
23583
|
-
return JSON.stringify(
|
|
23584
|
-
}
|
|
23585
|
-
function encodeAgentActivityEvent(message) {
|
|
23586
|
-
return JSON.stringify(decodeAgentActivityEvent(JSON.stringify(message)));
|
|
23587
|
-
}
|
|
23588
|
-
function encodeSessionCompletedEvent(message) {
|
|
23589
|
-
return JSON.stringify(decodeSessionCompletedEvent(JSON.stringify(message)));
|
|
23608
|
+
function encodeRuntimeHeartbeatEvent(message) {
|
|
23609
|
+
return JSON.stringify(decodeRuntimeHeartbeatEvent(JSON.stringify(message)));
|
|
23590
23610
|
}
|
|
23591
|
-
function
|
|
23592
|
-
return JSON.stringify(
|
|
23611
|
+
function encodeRuntimeHeartbeatAckEvent(message) {
|
|
23612
|
+
return JSON.stringify(decodeRuntimeHeartbeatAckEvent(JSON.stringify(message)));
|
|
23593
23613
|
}
|
|
23594
|
-
|
|
23595
|
-
|
|
23596
|
-
var MOBIUS_API_PREFIX = "/mobius/api";
|
|
23597
|
-
var API_PREFIX_PATTERN = /^\/[a-zA-Z0-9._~-]+(?:\/[a-zA-Z0-9._~-]+)*$/;
|
|
23598
|
-
var MobiusApiConfigurationError = class extends Error {
|
|
23599
|
-
code = "invalid_api_prefix";
|
|
23600
|
-
constructor() {
|
|
23601
|
-
super("The Mobius API prefix must be an absolute path without parameters");
|
|
23602
|
-
this.name = "MobiusApiConfigurationError";
|
|
23603
|
-
}
|
|
23604
|
-
};
|
|
23605
|
-
function parseMobiusApiPrefix(value) {
|
|
23606
|
-
if (typeof value !== "string" || !API_PREFIX_PATTERN.test(value)) {
|
|
23607
|
-
throw new MobiusApiConfigurationError();
|
|
23608
|
-
}
|
|
23609
|
-
return value;
|
|
23614
|
+
function encodeRuntimeDelivery(message) {
|
|
23615
|
+
return JSON.stringify(decodeRuntimeDelivery(JSON.stringify(message)));
|
|
23610
23616
|
}
|
|
23611
|
-
function
|
|
23612
|
-
return
|
|
23617
|
+
function encodeRuntimeDeliveryReceived(message) {
|
|
23618
|
+
return JSON.stringify(decodeRuntimeDeliveryReceived(JSON.stringify(message)));
|
|
23613
23619
|
}
|
|
23614
|
-
function
|
|
23615
|
-
return
|
|
23620
|
+
function encodeRuntimeDeliveryCommitted(message) {
|
|
23621
|
+
return JSON.stringify(decodeRuntimeDeliveryCommitted(JSON.stringify(message)));
|
|
23616
23622
|
}
|
|
23617
23623
|
|
|
23618
23624
|
// ../protocol/src/session-history.ts
|
|
@@ -23789,9 +23795,13 @@ function decode4(schema, encoded) {
|
|
|
23789
23795
|
}
|
|
23790
23796
|
}
|
|
23791
23797
|
var decodeNativeSessionCommand = (encoded) => decode4(nativeSessionCommandSchema, encoded);
|
|
23798
|
+
var encodeNativeSessionCommand = (value) => JSON.stringify(nativeSessionCommandSchema.parse(value));
|
|
23799
|
+
var decodeNativeSessionResult = (encoded) => decode4(nativeSessionResultSchema, encoded);
|
|
23792
23800
|
var encodeNativeSessionResult = (value) => JSON.stringify(nativeSessionResultSchema.parse(value));
|
|
23793
23801
|
var decodeNativeSessionCancel = (encoded) => decode4(nativeSessionCancelSchema, encoded);
|
|
23802
|
+
var encodeNativeSessionCancel = (value) => JSON.stringify(nativeSessionCancelSchema.parse(value));
|
|
23794
23803
|
var decodeNativeSessionTurnForkCommand = (encoded) => decode4(nativeSessionTurnForkCommandSchema, encoded);
|
|
23804
|
+
var encodeNativeSessionTurnForkCommand = (value) => JSON.stringify(nativeSessionTurnForkCommandSchema.parse(value));
|
|
23795
23805
|
|
|
23796
23806
|
// ../protocol/src/session-events.ts
|
|
23797
23807
|
var SESSION_EVENT_KIND = "session.event";
|
|
@@ -23883,8 +23893,285 @@ var encode4 = (message, schema) => {
|
|
|
23883
23893
|
var decodeSessionEventEnvelope = (encoded) => decode5(encoded, eventEnvelopeSchema);
|
|
23884
23894
|
var encodeSessionEventEnvelope = (message) => encode4(message, eventEnvelopeSchema);
|
|
23885
23895
|
var decodeSessionEventAcknowledgement = (encoded) => decode5(encoded, eventAcknowledgementSchema);
|
|
23896
|
+
var encodeSessionEventAcknowledgement = (message) => encode4(message, eventAcknowledgementSchema);
|
|
23886
23897
|
var decodeSessionEventDeferred = (encoded) => decode5(encoded, eventDeferredSchema);
|
|
23898
|
+
var encodeSessionEventDeferred = (message) => encode4(message, eventDeferredSchema);
|
|
23887
23899
|
var decodeSessionEventRejection = (encoded) => decode5(encoded, eventRejectionSchema);
|
|
23900
|
+
var encodeSessionEventRejection = (message) => encode4(message, eventRejectionSchema);
|
|
23901
|
+
function decodeRecordedSessionEvent(encoded) {
|
|
23902
|
+
const kind = decodeMessageKind(encoded);
|
|
23903
|
+
switch (kind) {
|
|
23904
|
+
case AGENT_ACTIVITY_KIND:
|
|
23905
|
+
return decodeAgentActivityEvent(encoded);
|
|
23906
|
+
case AGENT_CONTENT_KIND:
|
|
23907
|
+
return decodeAgentContentEvent(encoded);
|
|
23908
|
+
case AGENT_MESSAGE_DELTA_KIND:
|
|
23909
|
+
return decodeAgentMessageDeltaEvent(encoded);
|
|
23910
|
+
case SESSION_COMMANDS_UPDATED_KIND:
|
|
23911
|
+
return decodeSessionCommandsUpdatedEvent(encoded);
|
|
23912
|
+
case SESSION_COMPLETED_KIND:
|
|
23913
|
+
return decodeSessionCompletedEvent(encoded);
|
|
23914
|
+
case SESSION_CONFIG_UPDATED_KIND:
|
|
23915
|
+
return decodeSessionConfigUpdatedEvent(encoded);
|
|
23916
|
+
case SESSION_ELICITATION_REQUESTED_KIND:
|
|
23917
|
+
return decodeSessionElicitationRequestedEvent(encoded);
|
|
23918
|
+
case SESSION_ELICITATION_RESOLVED_KIND:
|
|
23919
|
+
return decodeSessionElicitationResolvedEvent(encoded);
|
|
23920
|
+
case SESSION_FAILED_KIND:
|
|
23921
|
+
return decodeSessionFailedEvent(encoded);
|
|
23922
|
+
case SESSION_INFO_UPDATED_KIND:
|
|
23923
|
+
return decodeSessionInfoUpdatedEvent(encoded);
|
|
23924
|
+
case SESSION_PERMISSION_REQUESTED_KIND:
|
|
23925
|
+
return decodeSessionPermissionRequestedEvent(encoded);
|
|
23926
|
+
case SESSION_PERMISSION_RESOLVED_KIND:
|
|
23927
|
+
return decodeSessionPermissionResolvedEvent(encoded);
|
|
23928
|
+
case SESSION_READY_KIND:
|
|
23929
|
+
return decodeSessionReadyEvent(encoded);
|
|
23930
|
+
case SESSION_STARTED_KIND:
|
|
23931
|
+
return decodeSessionStartedEvent(encoded);
|
|
23932
|
+
case SESSION_USAGE_UPDATED_KIND:
|
|
23933
|
+
return decodeSessionUsageUpdatedEvent(encoded);
|
|
23934
|
+
default:
|
|
23935
|
+
throw new ProtocolMessageError("Unsupported recorded session event");
|
|
23936
|
+
}
|
|
23937
|
+
}
|
|
23938
|
+
var encodeRecordedSessionEvent = (event) => JSON.stringify(decodeRecordedSessionEvent(JSON.stringify(event)));
|
|
23939
|
+
|
|
23940
|
+
// ../protocol/src/daemon-transport.ts
|
|
23941
|
+
function defineMessageSignature(kind, encoder, decoder) {
|
|
23942
|
+
const schema = (message) => decoder(JSON.stringify(message));
|
|
23943
|
+
return {
|
|
23944
|
+
decoder,
|
|
23945
|
+
encoder: (message) => encoder(schema(message)),
|
|
23946
|
+
kind,
|
|
23947
|
+
schema
|
|
23948
|
+
};
|
|
23949
|
+
}
|
|
23950
|
+
var serviceToDaemonSignatures = {
|
|
23951
|
+
[AGENT_CATALOG_REFRESH_KIND]: defineMessageSignature(
|
|
23952
|
+
AGENT_CATALOG_REFRESH_KIND,
|
|
23953
|
+
encodeAgentCatalogRefreshCommand,
|
|
23954
|
+
decodeAgentCatalogRefreshCommand
|
|
23955
|
+
),
|
|
23956
|
+
[AGENT_INSTALL_CANCEL_KIND]: defineMessageSignature(
|
|
23957
|
+
AGENT_INSTALL_CANCEL_KIND,
|
|
23958
|
+
encodeAgentInstallCancelCommand,
|
|
23959
|
+
decodeAgentInstallCancelCommand
|
|
23960
|
+
),
|
|
23961
|
+
[AGENT_INSTALL_REQUEST_KIND]: defineMessageSignature(
|
|
23962
|
+
AGENT_INSTALL_REQUEST_KIND,
|
|
23963
|
+
encodeAgentInstallRequestCommand,
|
|
23964
|
+
decodeAgentInstallRequestCommand
|
|
23965
|
+
),
|
|
23966
|
+
[AGENT_SETTINGS_DISCOVER_KIND]: defineMessageSignature(
|
|
23967
|
+
AGENT_SETTINGS_DISCOVER_KIND,
|
|
23968
|
+
encodeAgentSettingsDiscoverCommand,
|
|
23969
|
+
decodeAgentSettingsDiscoverCommand
|
|
23970
|
+
),
|
|
23971
|
+
[FILE_READ_KIND]: defineMessageSignature(FILE_READ_KIND, encodeFileReadCommand, decodeFileReadCommand),
|
|
23972
|
+
[NATIVE_SESSION_CANCEL_KIND]: defineMessageSignature(
|
|
23973
|
+
NATIVE_SESSION_CANCEL_KIND,
|
|
23974
|
+
encodeNativeSessionCancel,
|
|
23975
|
+
decodeNativeSessionCancel
|
|
23976
|
+
),
|
|
23977
|
+
[NATIVE_SESSION_REQUEST_KIND]: defineMessageSignature(
|
|
23978
|
+
NATIVE_SESSION_REQUEST_KIND,
|
|
23979
|
+
encodeNativeSessionCommand,
|
|
23980
|
+
decodeNativeSessionCommand
|
|
23981
|
+
),
|
|
23982
|
+
[NATIVE_SESSION_TURN_FORK_KIND]: defineMessageSignature(
|
|
23983
|
+
NATIVE_SESSION_TURN_FORK_KIND,
|
|
23984
|
+
encodeNativeSessionTurnForkCommand,
|
|
23985
|
+
decodeNativeSessionTurnForkCommand
|
|
23986
|
+
),
|
|
23987
|
+
[RUNTIME_DELIVERY_KIND]: defineMessageSignature(
|
|
23988
|
+
RUNTIME_DELIVERY_KIND,
|
|
23989
|
+
encodeRuntimeDelivery,
|
|
23990
|
+
decodeRuntimeDelivery
|
|
23991
|
+
),
|
|
23992
|
+
[RUNTIME_DELIVERY_COMMITTED_KIND]: defineMessageSignature(
|
|
23993
|
+
RUNTIME_DELIVERY_COMMITTED_KIND,
|
|
23994
|
+
encodeRuntimeDeliveryCommitted,
|
|
23995
|
+
decodeRuntimeDeliveryCommitted
|
|
23996
|
+
),
|
|
23997
|
+
[RUNTIME_HEARTBEAT_ACK_KIND]: defineMessageSignature(
|
|
23998
|
+
RUNTIME_HEARTBEAT_ACK_KIND,
|
|
23999
|
+
encodeRuntimeHeartbeatAckEvent,
|
|
24000
|
+
decodeRuntimeHeartbeatAckEvent
|
|
24001
|
+
),
|
|
24002
|
+
[RUNTIME_LIVENESS_READY_KIND]: defineMessageSignature(
|
|
24003
|
+
RUNTIME_LIVENESS_READY_KIND,
|
|
24004
|
+
encodeRuntimeLivenessReadyEvent,
|
|
24005
|
+
decodeRuntimeLivenessReadyEvent
|
|
24006
|
+
),
|
|
24007
|
+
[SESSION_CANCEL_KIND]: defineMessageSignature(
|
|
24008
|
+
SESSION_CANCEL_KIND,
|
|
24009
|
+
encodeSessionCancelCommand,
|
|
24010
|
+
decodeSessionCancelCommand
|
|
24011
|
+
),
|
|
24012
|
+
[SESSION_CONFIGURE_KIND]: defineMessageSignature(
|
|
24013
|
+
SESSION_CONFIGURE_KIND,
|
|
24014
|
+
encodeSessionConfigureCommand,
|
|
24015
|
+
decodeSessionConfigureCommand
|
|
24016
|
+
),
|
|
24017
|
+
[SESSION_ELICITATION_RESPOND_KIND]: defineMessageSignature(
|
|
24018
|
+
SESSION_ELICITATION_RESPOND_KIND,
|
|
24019
|
+
encodeSessionElicitationRespondCommand,
|
|
24020
|
+
decodeSessionElicitationRespondCommand
|
|
24021
|
+
),
|
|
24022
|
+
[SESSION_EVENT_ACK_KIND]: defineMessageSignature(
|
|
24023
|
+
SESSION_EVENT_ACK_KIND,
|
|
24024
|
+
encodeSessionEventAcknowledgement,
|
|
24025
|
+
decodeSessionEventAcknowledgement
|
|
24026
|
+
),
|
|
24027
|
+
[SESSION_EVENT_DEFERRED_KIND]: defineMessageSignature(
|
|
24028
|
+
SESSION_EVENT_DEFERRED_KIND,
|
|
24029
|
+
encodeSessionEventDeferred,
|
|
24030
|
+
decodeSessionEventDeferred
|
|
24031
|
+
),
|
|
24032
|
+
[SESSION_EVENT_REJECTED_KIND]: defineMessageSignature(
|
|
24033
|
+
SESSION_EVENT_REJECTED_KIND,
|
|
24034
|
+
encodeSessionEventRejection,
|
|
24035
|
+
decodeSessionEventRejection
|
|
24036
|
+
),
|
|
24037
|
+
[SESSION_PERMISSION_RESPOND_KIND]: defineMessageSignature(
|
|
24038
|
+
SESSION_PERMISSION_RESPOND_KIND,
|
|
24039
|
+
encodeSessionPermissionRespondCommand,
|
|
24040
|
+
decodeSessionPermissionRespondCommand
|
|
24041
|
+
),
|
|
24042
|
+
[SESSION_PREPARE_KIND]: defineMessageSignature(
|
|
24043
|
+
SESSION_PREPARE_KIND,
|
|
24044
|
+
encodeSessionPrepareCommand,
|
|
24045
|
+
decodeSessionPrepareCommand
|
|
24046
|
+
),
|
|
24047
|
+
[SESSION_PROMPT_KIND]: defineMessageSignature(
|
|
24048
|
+
SESSION_PROMPT_KIND,
|
|
24049
|
+
encodeSessionPromptCommand,
|
|
24050
|
+
decodeSessionPromptCommand
|
|
24051
|
+
),
|
|
24052
|
+
[WORKSPACE_LIST_KIND]: defineMessageSignature(
|
|
24053
|
+
WORKSPACE_LIST_KIND,
|
|
24054
|
+
encodeWorkspaceListCommand,
|
|
24055
|
+
decodeWorkspaceListCommand
|
|
24056
|
+
)
|
|
24057
|
+
};
|
|
24058
|
+
var serviceToDaemonRegistry = serviceToDaemonSignatures;
|
|
24059
|
+
function decodeServiceToDaemonMessage(encoded) {
|
|
24060
|
+
const kind = decodeMessageKind(encoded);
|
|
24061
|
+
const signature = serviceToDaemonRegistry[kind];
|
|
24062
|
+
if (signature === void 0) {
|
|
24063
|
+
throw new ProtocolMessageError(`Unsupported service-to-daemon message kind: ${kind}`);
|
|
24064
|
+
}
|
|
24065
|
+
return signature.decoder(encoded);
|
|
24066
|
+
}
|
|
24067
|
+
var daemonToServiceSignatures = {
|
|
24068
|
+
[AGENT_CATALOG_REFRESHED_KIND]: defineMessageSignature(
|
|
24069
|
+
AGENT_CATALOG_REFRESHED_KIND,
|
|
24070
|
+
encodeAgentCatalogRefreshedEvent,
|
|
24071
|
+
decodeAgentCatalogRefreshedEvent
|
|
24072
|
+
),
|
|
24073
|
+
[AGENT_CATALOG_REFRESH_FAILED_KIND]: defineMessageSignature(
|
|
24074
|
+
AGENT_CATALOG_REFRESH_FAILED_KIND,
|
|
24075
|
+
encodeAgentCatalogRefreshFailedEvent,
|
|
24076
|
+
decodeAgentCatalogRefreshFailedEvent
|
|
24077
|
+
),
|
|
24078
|
+
[AGENT_INSTALL_CANCELLED_KIND]: defineMessageSignature(
|
|
24079
|
+
AGENT_INSTALL_CANCELLED_KIND,
|
|
24080
|
+
encodeAgentInstallCancelledEvent,
|
|
24081
|
+
decodeAgentInstallCancelledEvent
|
|
24082
|
+
),
|
|
24083
|
+
[AGENT_INSTALL_COMPLETED_KIND]: defineMessageSignature(
|
|
24084
|
+
AGENT_INSTALL_COMPLETED_KIND,
|
|
24085
|
+
encodeAgentInstallCompletedEvent,
|
|
24086
|
+
decodeAgentInstallCompletedEvent
|
|
24087
|
+
),
|
|
24088
|
+
[AGENT_INSTALL_FAILED_KIND]: defineMessageSignature(
|
|
24089
|
+
AGENT_INSTALL_FAILED_KIND,
|
|
24090
|
+
encodeAgentInstallFailedEvent,
|
|
24091
|
+
decodeAgentInstallFailedEvent
|
|
24092
|
+
),
|
|
24093
|
+
[AGENT_INSTALL_PROGRESS_KIND]: defineMessageSignature(
|
|
24094
|
+
AGENT_INSTALL_PROGRESS_KIND,
|
|
24095
|
+
encodeAgentInstallProgressEvent,
|
|
24096
|
+
decodeAgentInstallProgressEvent
|
|
24097
|
+
),
|
|
24098
|
+
[AGENT_INSTALL_STARTED_KIND]: defineMessageSignature(
|
|
24099
|
+
AGENT_INSTALL_STARTED_KIND,
|
|
24100
|
+
encodeAgentInstallStartedEvent,
|
|
24101
|
+
decodeAgentInstallStartedEvent
|
|
24102
|
+
),
|
|
24103
|
+
[AGENT_SETTINGS_DISCOVERED_KIND]: defineMessageSignature(
|
|
24104
|
+
AGENT_SETTINGS_DISCOVERED_KIND,
|
|
24105
|
+
encodeAgentSettingsDiscoveredEvent,
|
|
24106
|
+
decodeAgentSettingsDiscoveredEvent
|
|
24107
|
+
),
|
|
24108
|
+
[AGENT_SETTINGS_DISCOVERY_FAILED_KIND]: defineMessageSignature(
|
|
24109
|
+
AGENT_SETTINGS_DISCOVERY_FAILED_KIND,
|
|
24110
|
+
encodeAgentSettingsDiscoveryFailedEvent,
|
|
24111
|
+
decodeAgentSettingsDiscoveryFailedEvent
|
|
24112
|
+
),
|
|
24113
|
+
[FILE_BEGIN_KIND]: defineMessageSignature(FILE_BEGIN_KIND, encodeFileBeginEvent, decodeFileBeginEvent),
|
|
24114
|
+
[FILE_CHUNK_KIND]: defineMessageSignature(FILE_CHUNK_KIND, encodeFileChunkEvent, decodeFileChunkEvent),
|
|
24115
|
+
[FILE_END_KIND]: defineMessageSignature(FILE_END_KIND, encodeFileEndEvent, decodeFileEndEvent),
|
|
24116
|
+
[FILE_FAILED_KIND]: defineMessageSignature(FILE_FAILED_KIND, encodeFileFailedEvent, decodeFileFailedEvent),
|
|
24117
|
+
[NATIVE_SESSION_RESULT_KIND]: defineMessageSignature(
|
|
24118
|
+
NATIVE_SESSION_RESULT_KIND,
|
|
24119
|
+
encodeNativeSessionResult,
|
|
24120
|
+
decodeNativeSessionResult
|
|
24121
|
+
),
|
|
24122
|
+
[RUNTIME_DELIVERY_RECEIVED_KIND]: defineMessageSignature(
|
|
24123
|
+
RUNTIME_DELIVERY_RECEIVED_KIND,
|
|
24124
|
+
encodeRuntimeDeliveryReceived,
|
|
24125
|
+
decodeRuntimeDeliveryReceived
|
|
24126
|
+
),
|
|
24127
|
+
[RUNTIME_HEARTBEAT_KIND]: defineMessageSignature(
|
|
24128
|
+
RUNTIME_HEARTBEAT_KIND,
|
|
24129
|
+
encodeRuntimeHeartbeatEvent,
|
|
24130
|
+
decodeRuntimeHeartbeatEvent
|
|
24131
|
+
),
|
|
24132
|
+
[SESSION_EVENT_KIND]: defineMessageSignature(
|
|
24133
|
+
SESSION_EVENT_KIND,
|
|
24134
|
+
encodeSessionEventEnvelope,
|
|
24135
|
+
decodeSessionEventEnvelope
|
|
24136
|
+
),
|
|
24137
|
+
[SESSION_OPERATION_FAILED_KIND]: defineMessageSignature(
|
|
24138
|
+
SESSION_OPERATION_FAILED_KIND,
|
|
24139
|
+
encodeSessionOperationFailedEvent,
|
|
24140
|
+
decodeSessionOperationFailedEvent
|
|
24141
|
+
),
|
|
24142
|
+
[SESSION_READY_KIND]: defineMessageSignature(SESSION_READY_KIND, encodeSessionReadyEvent, decodeSessionReadyEvent),
|
|
24143
|
+
[WORKSPACE_ENTRIES_KIND]: defineMessageSignature(
|
|
24144
|
+
WORKSPACE_ENTRIES_KIND,
|
|
24145
|
+
encodeWorkspaceEntriesEvent,
|
|
24146
|
+
decodeWorkspaceEntriesEvent
|
|
24147
|
+
)
|
|
24148
|
+
};
|
|
24149
|
+
function encodeDaemonToServiceMessage(message) {
|
|
24150
|
+
return daemonToServiceSignatures[message.kind].encoder(message);
|
|
24151
|
+
}
|
|
24152
|
+
|
|
24153
|
+
// ../protocol/src/mobius-api.ts
|
|
24154
|
+
var MOBIUS_API_PREFIX = "/mobius/api";
|
|
24155
|
+
var API_PREFIX_PATTERN = /^\/[a-zA-Z0-9._~-]+(?:\/[a-zA-Z0-9._~-]+)*$/;
|
|
24156
|
+
var MobiusApiConfigurationError = class extends Error {
|
|
24157
|
+
code = "invalid_api_prefix";
|
|
24158
|
+
constructor() {
|
|
24159
|
+
super("The Mobius API prefix must be an absolute path without parameters");
|
|
24160
|
+
this.name = "MobiusApiConfigurationError";
|
|
24161
|
+
}
|
|
24162
|
+
};
|
|
24163
|
+
function parseMobiusApiPrefix(value) {
|
|
24164
|
+
if (typeof value !== "string" || !API_PREFIX_PATTERN.test(value)) {
|
|
24165
|
+
throw new MobiusApiConfigurationError();
|
|
24166
|
+
}
|
|
24167
|
+
return value;
|
|
24168
|
+
}
|
|
24169
|
+
function mobiusApiPath(resourcePath, apiPrefix = MOBIUS_API_PREFIX) {
|
|
24170
|
+
return `${parseMobiusApiPrefix(apiPrefix)}${resourcePath}`;
|
|
24171
|
+
}
|
|
24172
|
+
function mobiusApiUrl(origin, resourcePath, apiPrefix = MOBIUS_API_PREFIX) {
|
|
24173
|
+
return new URL(mobiusApiPath(resourcePath, apiPrefix), origin);
|
|
24174
|
+
}
|
|
23888
24175
|
|
|
23889
24176
|
// src/config.ts
|
|
23890
24177
|
function loadDefaultWorkspace(environment = process.env) {
|
|
@@ -35707,11 +35994,42 @@ function relayHttpEndpoint(relayUrl) {
|
|
|
35707
35994
|
var CATALOG_UPDATE_TIMEOUT_MILLISECONDS = 2e4;
|
|
35708
35995
|
var AgentCatalogPublishError = class extends Error {
|
|
35709
35996
|
code = "agent_catalog_update_failed";
|
|
35710
|
-
|
|
35997
|
+
diagnosticDetails;
|
|
35998
|
+
constructor(message, options = {}, diagnosticDetails = {}) {
|
|
35711
35999
|
super(message, options);
|
|
36000
|
+
this.diagnosticDetails = diagnosticDetails;
|
|
35712
36001
|
this.name = "AgentCatalogPublishError";
|
|
35713
36002
|
}
|
|
35714
36003
|
};
|
|
36004
|
+
function isRecord8(value) {
|
|
36005
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
36006
|
+
}
|
|
36007
|
+
function isSafeRelayErrorMessage(value) {
|
|
36008
|
+
return value.length > 0 && value.length <= 512 && Array.from(value).every((character) => character.charCodeAt(0) >= 32 && character.charCodeAt(0) !== 127);
|
|
36009
|
+
}
|
|
36010
|
+
async function rejectedCatalogError(response) {
|
|
36011
|
+
let value;
|
|
36012
|
+
try {
|
|
36013
|
+
value = await response.json();
|
|
36014
|
+
} catch {
|
|
36015
|
+
return new AgentCatalogPublishError("The Relay rejected the Agent catalog update");
|
|
36016
|
+
}
|
|
36017
|
+
if (!isRecord8(value) || !isRecord8(value["error"])) {
|
|
36018
|
+
return new AgentCatalogPublishError("The Relay rejected the Agent catalog update");
|
|
36019
|
+
}
|
|
36020
|
+
const code = value["error"]["code"];
|
|
36021
|
+
const message = value["error"]["message"];
|
|
36022
|
+
if (typeof code !== "string" || !/^[a-z][a-z0-9_]{0,63}$/.test(code) || typeof message !== "string" || !isSafeRelayErrorMessage(message)) {
|
|
36023
|
+
return new AgentCatalogPublishError("The Relay rejected the Agent catalog update");
|
|
36024
|
+
}
|
|
36025
|
+
return new AgentCatalogPublishError(
|
|
36026
|
+
`The Relay rejected the Agent catalog update (${code}): ${message}`,
|
|
36027
|
+
{},
|
|
36028
|
+
{
|
|
36029
|
+
relayErrorCode: code
|
|
36030
|
+
}
|
|
36031
|
+
);
|
|
36032
|
+
}
|
|
35715
36033
|
function catalogEndpoint(config2) {
|
|
35716
36034
|
const endpoint = relayHttpEndpoint(config2.relayUrl);
|
|
35717
36035
|
if (endpoint.pathname.endsWith("/daemon")) {
|
|
@@ -35759,10 +36077,10 @@ async function publishAgentCatalog(config2, signal) {
|
|
|
35759
36077
|
{ cause: error62 }
|
|
35760
36078
|
);
|
|
35761
36079
|
}
|
|
35762
|
-
await response.body?.cancel();
|
|
35763
36080
|
if (!response.ok) {
|
|
35764
|
-
throw
|
|
36081
|
+
throw await rejectedCatalogError(response);
|
|
35765
36082
|
}
|
|
36083
|
+
await response.body?.cancel();
|
|
35766
36084
|
}
|
|
35767
36085
|
|
|
35768
36086
|
// src/agent-installation/agent-installation-manager.ts
|
|
@@ -36271,30 +36589,26 @@ async function streamLocalFile(command, send2, signal) {
|
|
|
36271
36589
|
throw new Error("The local file is too large to read");
|
|
36272
36590
|
}
|
|
36273
36591
|
const raster = await readLocalRaster(target, signal);
|
|
36274
|
-
send2(
|
|
36275
|
-
|
|
36276
|
-
|
|
36277
|
-
|
|
36278
|
-
|
|
36279
|
-
|
|
36280
|
-
|
|
36281
|
-
|
|
36282
|
-
|
|
36283
|
-
})
|
|
36284
|
-
);
|
|
36592
|
+
send2({
|
|
36593
|
+
byteLength: before.size,
|
|
36594
|
+
kind: FILE_BEGIN_KIND,
|
|
36595
|
+
mediaType: raster?.mimeType ?? "application/octet-stream",
|
|
36596
|
+
modifiedAt: before.mtime.toISOString(),
|
|
36597
|
+
name: basename3(target) || "file",
|
|
36598
|
+
requestId: command.requestId,
|
|
36599
|
+
sessionId: command.sessionId
|
|
36600
|
+
});
|
|
36285
36601
|
let sequence = 0;
|
|
36286
36602
|
const stream = createReadStream2(target, { highWaterMark: CHUNK_BYTES, signal });
|
|
36287
36603
|
for await (const value of stream) {
|
|
36288
36604
|
const bytes = value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
36289
|
-
send2(
|
|
36290
|
-
|
|
36291
|
-
|
|
36292
|
-
|
|
36293
|
-
|
|
36294
|
-
|
|
36295
|
-
|
|
36296
|
-
})
|
|
36297
|
-
);
|
|
36605
|
+
send2({
|
|
36606
|
+
data: Buffer.from(bytes).toString("base64"),
|
|
36607
|
+
kind: FILE_CHUNK_KIND,
|
|
36608
|
+
requestId: command.requestId,
|
|
36609
|
+
sequence,
|
|
36610
|
+
sessionId: command.sessionId
|
|
36611
|
+
});
|
|
36298
36612
|
sequence += 1;
|
|
36299
36613
|
}
|
|
36300
36614
|
const after = await stat6(target);
|
|
@@ -36302,13 +36616,11 @@ async function streamLocalFile(command, send2, signal) {
|
|
|
36302
36616
|
if (after.size !== before.size || after.mtimeMs !== before.mtimeMs) {
|
|
36303
36617
|
throw new Error("The local file changed during transfer");
|
|
36304
36618
|
}
|
|
36305
|
-
send2(
|
|
36306
|
-
|
|
36307
|
-
|
|
36308
|
-
|
|
36309
|
-
|
|
36310
|
-
})
|
|
36311
|
-
);
|
|
36619
|
+
send2({
|
|
36620
|
+
kind: FILE_END_KIND,
|
|
36621
|
+
requestId: command.requestId,
|
|
36622
|
+
sessionId: command.sessionId
|
|
36623
|
+
});
|
|
36312
36624
|
}
|
|
36313
36625
|
|
|
36314
36626
|
// src/artifacts/runtime-artifact-uploader.ts
|
|
@@ -36341,11 +36653,11 @@ var IDENTIFIER_PATTERN4 = /^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$/;
|
|
|
36341
36653
|
function invalidResponse(message) {
|
|
36342
36654
|
return new MobiusProtocolError(message);
|
|
36343
36655
|
}
|
|
36344
|
-
function
|
|
36656
|
+
function isRecord9(value) {
|
|
36345
36657
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
36346
36658
|
}
|
|
36347
36659
|
function record2(value, name) {
|
|
36348
|
-
if (!
|
|
36660
|
+
if (!isRecord9(value)) {
|
|
36349
36661
|
throw invalidResponse(`The service returned an invalid ${name}`);
|
|
36350
36662
|
}
|
|
36351
36663
|
return value;
|
|
@@ -38153,12 +38465,10 @@ var RelayConnectionLiveness = class {
|
|
|
38153
38465
|
heartbeatId,
|
|
38154
38466
|
this.#timer.schedule(this.#handleTimeout, HEARTBEAT_ACK_TIMEOUT_MILLISECONDS)
|
|
38155
38467
|
);
|
|
38156
|
-
const sent = this.#transport.send(
|
|
38157
|
-
|
|
38158
|
-
|
|
38159
|
-
|
|
38160
|
-
})
|
|
38161
|
-
);
|
|
38468
|
+
const sent = this.#transport.send({
|
|
38469
|
+
heartbeatId,
|
|
38470
|
+
kind: RUNTIME_HEARTBEAT_KIND
|
|
38471
|
+
});
|
|
38162
38472
|
if (!sent && this.#state instanceof AwaitingHeartbeatAckState && this.#state.heartbeatId === heartbeatId) {
|
|
38163
38473
|
this.#state.timeout.cancel();
|
|
38164
38474
|
this.#state = new FinishedRelayLivenessState();
|
|
@@ -38778,39 +39088,39 @@ var DaemonAcpObserver = class {
|
|
|
38778
39088
|
}
|
|
38779
39089
|
importLocalArtifact = async (sessionId, artifact, signal) => (await uploadRuntimeArtifact(this.#config, sessionId, artifact, signal)).artifactId;
|
|
38780
39090
|
onCommands = (event) => {
|
|
38781
|
-
this.#record(event.sessionId,
|
|
39091
|
+
this.#record(event.sessionId, event);
|
|
38782
39092
|
return Promise.resolve();
|
|
38783
39093
|
};
|
|
38784
39094
|
onConfig = (event) => {
|
|
38785
|
-
this.#record(event.sessionId,
|
|
39095
|
+
this.#record(event.sessionId, event);
|
|
38786
39096
|
return Promise.resolve();
|
|
38787
39097
|
};
|
|
38788
39098
|
onContent = (event) => {
|
|
38789
|
-
this.#record(event.sessionId,
|
|
39099
|
+
this.#record(event.sessionId, event);
|
|
38790
39100
|
return Promise.resolve();
|
|
38791
39101
|
};
|
|
38792
39102
|
onElicitation = (event) => {
|
|
38793
|
-
this.#record(event.sessionId,
|
|
39103
|
+
this.#record(event.sessionId, event);
|
|
38794
39104
|
return Promise.resolve();
|
|
38795
39105
|
};
|
|
38796
39106
|
onElicitationResolved = (event) => {
|
|
38797
|
-
this.#record(event.sessionId,
|
|
39107
|
+
this.#record(event.sessionId, event);
|
|
38798
39108
|
return Promise.resolve();
|
|
38799
39109
|
};
|
|
38800
39110
|
onInfo = (event) => {
|
|
38801
|
-
this.#record(event.sessionId,
|
|
39111
|
+
this.#record(event.sessionId, event);
|
|
38802
39112
|
return Promise.resolve();
|
|
38803
39113
|
};
|
|
38804
39114
|
onPermission = (event) => {
|
|
38805
|
-
this.#record(event.sessionId,
|
|
39115
|
+
this.#record(event.sessionId, event);
|
|
38806
39116
|
return Promise.resolve();
|
|
38807
39117
|
};
|
|
38808
39118
|
onPermissionResolved = (event) => {
|
|
38809
|
-
this.#record(event.sessionId,
|
|
39119
|
+
this.#record(event.sessionId, event);
|
|
38810
39120
|
return Promise.resolve();
|
|
38811
39121
|
};
|
|
38812
39122
|
onUsage = (event) => {
|
|
38813
|
-
this.#record(event.sessionId,
|
|
39123
|
+
this.#record(event.sessionId, event);
|
|
38814
39124
|
return Promise.resolve();
|
|
38815
39125
|
};
|
|
38816
39126
|
};
|
|
@@ -38859,60 +39169,45 @@ var DaemonInstallationObserver = class {
|
|
|
38859
39169
|
if (state instanceof RunningInstallation) {
|
|
38860
39170
|
if (!this.#started.has(state.requestId)) {
|
|
38861
39171
|
this.#started.add(state.requestId);
|
|
38862
|
-
this.#send(
|
|
38863
|
-
socket,
|
|
38864
|
-
encodeAgentInstallStartedEvent({
|
|
38865
|
-
agentId: state.agentId,
|
|
38866
|
-
kind: AGENT_INSTALL_STARTED_KIND,
|
|
38867
|
-
requestId: state.requestId
|
|
38868
|
-
})
|
|
38869
|
-
);
|
|
38870
|
-
}
|
|
38871
|
-
this.#send(
|
|
38872
|
-
socket,
|
|
38873
|
-
encodeAgentInstallProgressEvent({
|
|
39172
|
+
this.#send(socket, {
|
|
38874
39173
|
agentId: state.agentId,
|
|
38875
|
-
kind:
|
|
38876
|
-
requestId: state.requestId
|
|
38877
|
-
|
|
38878
|
-
|
|
38879
|
-
|
|
39174
|
+
kind: AGENT_INSTALL_STARTED_KIND,
|
|
39175
|
+
requestId: state.requestId
|
|
39176
|
+
});
|
|
39177
|
+
}
|
|
39178
|
+
this.#send(socket, {
|
|
39179
|
+
agentId: state.agentId,
|
|
39180
|
+
kind: AGENT_INSTALL_PROGRESS_KIND,
|
|
39181
|
+
requestId: state.requestId,
|
|
39182
|
+
stage: state.stage
|
|
39183
|
+
});
|
|
38880
39184
|
return Promise.resolve();
|
|
38881
39185
|
}
|
|
38882
39186
|
if (state instanceof SucceededInstallation) {
|
|
38883
|
-
this.#send(
|
|
38884
|
-
|
|
38885
|
-
|
|
38886
|
-
|
|
38887
|
-
|
|
38888
|
-
|
|
38889
|
-
requestId: state.requestId
|
|
38890
|
-
})
|
|
38891
|
-
);
|
|
39187
|
+
this.#send(socket, {
|
|
39188
|
+
agentId: state.agentId,
|
|
39189
|
+
authenticationMayBeRequired: state.authenticationMayBeRequired,
|
|
39190
|
+
kind: AGENT_INSTALL_COMPLETED_KIND,
|
|
39191
|
+
requestId: state.requestId
|
|
39192
|
+
});
|
|
38892
39193
|
return Promise.resolve();
|
|
38893
39194
|
}
|
|
38894
39195
|
if (state instanceof FailedInstallation) {
|
|
38895
|
-
this.#send(
|
|
38896
|
-
|
|
38897
|
-
|
|
38898
|
-
|
|
38899
|
-
|
|
38900
|
-
|
|
38901
|
-
|
|
38902
|
-
requestId: state.requestId
|
|
38903
|
-
})
|
|
38904
|
-
);
|
|
39196
|
+
this.#send(socket, {
|
|
39197
|
+
agentId: state.agentId,
|
|
39198
|
+
code: state.code,
|
|
39199
|
+
kind: AGENT_INSTALL_FAILED_KIND,
|
|
39200
|
+
message: state.message,
|
|
39201
|
+
requestId: state.requestId
|
|
39202
|
+
});
|
|
38905
39203
|
return Promise.resolve();
|
|
38906
39204
|
}
|
|
38907
39205
|
if (state instanceof CancelledInstallation) {
|
|
38908
|
-
this.#send(
|
|
38909
|
-
|
|
38910
|
-
|
|
38911
|
-
|
|
38912
|
-
|
|
38913
|
-
requestId: state.requestId
|
|
38914
|
-
})
|
|
38915
|
-
);
|
|
39206
|
+
this.#send(socket, {
|
|
39207
|
+
agentId: state.agentId,
|
|
39208
|
+
kind: AGENT_INSTALL_CANCELLED_KIND,
|
|
39209
|
+
requestId: state.requestId
|
|
39210
|
+
});
|
|
38916
39211
|
return Promise.resolve();
|
|
38917
39212
|
}
|
|
38918
39213
|
throw new Error("Unsupported Agent integration installation state");
|
|
@@ -39042,7 +39337,7 @@ function send(socket, message) {
|
|
|
39042
39337
|
if (socket.readyState !== WebSocket2.OPEN) {
|
|
39043
39338
|
throw new Error("Relay connection is not open");
|
|
39044
39339
|
}
|
|
39045
|
-
socket.send(message);
|
|
39340
|
+
socket.send(encodeDaemonToServiceMessage(message));
|
|
39046
39341
|
}
|
|
39047
39342
|
function closeRelaySocket(socket, code, reason) {
|
|
39048
39343
|
try {
|
|
@@ -39076,7 +39371,7 @@ var ConnectedDaemonSessionEventState = class extends DaemonSessionEventConnectio
|
|
|
39076
39371
|
return false;
|
|
39077
39372
|
}
|
|
39078
39373
|
try {
|
|
39079
|
-
this.#socket.send(message);
|
|
39374
|
+
this.#socket.send(encodeDaemonToServiceMessage(message));
|
|
39080
39375
|
return true;
|
|
39081
39376
|
} catch {
|
|
39082
39377
|
return false;
|
|
@@ -39120,17 +39415,17 @@ var DaemonSessionEventPublisher = class {
|
|
|
39120
39415
|
this.#connection = this.#connection.disconnect(socket);
|
|
39121
39416
|
this.#clearInFlight();
|
|
39122
39417
|
};
|
|
39123
|
-
recordAttempt = (sessionId,
|
|
39124
|
-
const
|
|
39125
|
-
if (kind === SESSION_COMPLETED_KIND || kind === SESSION_FAILED_KIND) {
|
|
39126
|
-
this.#outbox.enqueueCritical(sessionId,
|
|
39418
|
+
recordAttempt = (sessionId, event, attemptId) => {
|
|
39419
|
+
const encoded = encodeRecordedSessionEvent(event);
|
|
39420
|
+
if (event.kind === SESSION_COMPLETED_KIND || event.kind === SESSION_FAILED_KIND) {
|
|
39421
|
+
this.#outbox.enqueueCritical(sessionId, encoded, attemptId);
|
|
39127
39422
|
} else {
|
|
39128
|
-
this.#outbox.enqueue(sessionId,
|
|
39423
|
+
this.#outbox.enqueue(sessionId, encoded, attemptId);
|
|
39129
39424
|
}
|
|
39130
39425
|
this.#publishNextBatch();
|
|
39131
39426
|
};
|
|
39132
|
-
recordRuntime = (sessionId,
|
|
39133
|
-
this.#outbox.enqueue(sessionId,
|
|
39427
|
+
recordRuntime = (sessionId, event) => {
|
|
39428
|
+
this.#outbox.enqueue(sessionId, encodeRecordedSessionEvent(event));
|
|
39134
39429
|
this.#publishNextBatch();
|
|
39135
39430
|
};
|
|
39136
39431
|
acknowledge = (acknowledgement) => {
|
|
@@ -39197,7 +39492,7 @@ var DaemonSessionEventPublisher = class {
|
|
|
39197
39492
|
if (this.#inFlightBytes + byteLength > SESSION_EVENT_REPLAY_BYTE_LIMIT) {
|
|
39198
39493
|
continue;
|
|
39199
39494
|
}
|
|
39200
|
-
if (!this.#connection.send(
|
|
39495
|
+
if (!this.#connection.send(envelope2)) {
|
|
39201
39496
|
this.#clearInFlight();
|
|
39202
39497
|
return;
|
|
39203
39498
|
}
|
|
@@ -39291,8 +39586,8 @@ var CoalescingDaemonActivityPublisher = class {
|
|
|
39291
39586
|
}
|
|
39292
39587
|
};
|
|
39293
39588
|
};
|
|
39294
|
-
function
|
|
39295
|
-
return
|
|
39589
|
+
function daemonActivity(command, activity) {
|
|
39590
|
+
return {
|
|
39296
39591
|
activityId: activity.activityId,
|
|
39297
39592
|
activityType: activity.activityType,
|
|
39298
39593
|
commandId: command.commandId,
|
|
@@ -39308,18 +39603,18 @@ function encodeDaemonActivity(command, activity) {
|
|
|
39308
39603
|
status: activity.status,
|
|
39309
39604
|
title: activity.title,
|
|
39310
39605
|
toolKind: activity.toolKind
|
|
39311
|
-
}
|
|
39606
|
+
};
|
|
39312
39607
|
}
|
|
39313
39608
|
function reportFailure(publisher, command, code, message, attemptId) {
|
|
39314
39609
|
publisher.recordAttempt(
|
|
39315
39610
|
command.sessionId,
|
|
39316
|
-
|
|
39611
|
+
{
|
|
39317
39612
|
code,
|
|
39318
39613
|
commandId: command.commandId,
|
|
39319
39614
|
kind: SESSION_FAILED_KIND,
|
|
39320
39615
|
message,
|
|
39321
39616
|
sessionId: command.sessionId
|
|
39322
|
-
}
|
|
39617
|
+
},
|
|
39323
39618
|
attemptId
|
|
39324
39619
|
);
|
|
39325
39620
|
}
|
|
@@ -39339,17 +39634,14 @@ function reportOperationFailure(socket, requestId, sessionId, error62, runtimeTi
|
|
|
39339
39634
|
if (socket.readyState !== WebSocket2.OPEN) {
|
|
39340
39635
|
return;
|
|
39341
39636
|
}
|
|
39342
|
-
send(
|
|
39343
|
-
|
|
39344
|
-
|
|
39345
|
-
|
|
39346
|
-
|
|
39347
|
-
|
|
39348
|
-
|
|
39349
|
-
|
|
39350
|
-
sessionId
|
|
39351
|
-
})
|
|
39352
|
-
);
|
|
39637
|
+
send(socket, {
|
|
39638
|
+
code: operationErrorCode(error62),
|
|
39639
|
+
kind: "session.operation.failed",
|
|
39640
|
+
message: operationErrorMessage(error62),
|
|
39641
|
+
requestId,
|
|
39642
|
+
...runtimeTimings.length === 0 ? {} : { runtimeTimings },
|
|
39643
|
+
sessionId
|
|
39644
|
+
});
|
|
39353
39645
|
}
|
|
39354
39646
|
async function resolveSessionDirectories(directories, bindingId, directoryId2, additionalDirectoryIds, signal) {
|
|
39355
39647
|
const cwd = await directories.resolve(bindingId, directoryId2, signal);
|
|
@@ -39541,18 +39833,15 @@ async function executeWorkspaceList(socket, command, directories, audit, signal)
|
|
|
39541
39833
|
event: "workspace_list_authorized",
|
|
39542
39834
|
sessionId: "workspace-browser"
|
|
39543
39835
|
});
|
|
39544
|
-
send(
|
|
39545
|
-
|
|
39546
|
-
|
|
39547
|
-
|
|
39548
|
-
|
|
39549
|
-
|
|
39550
|
-
|
|
39551
|
-
|
|
39552
|
-
|
|
39553
|
-
requestId: command.requestId
|
|
39554
|
-
})
|
|
39555
|
-
);
|
|
39836
|
+
send(socket, {
|
|
39837
|
+
bindingId: command.bindingId,
|
|
39838
|
+
directoryId: listing.directoryId,
|
|
39839
|
+
directoryLabel: listing.directoryLabel,
|
|
39840
|
+
entries: listing.entries,
|
|
39841
|
+
kind: "workspace.entries",
|
|
39842
|
+
parentDirectoryId: listing.parentDirectoryId,
|
|
39843
|
+
requestId: command.requestId
|
|
39844
|
+
});
|
|
39556
39845
|
} catch (error62) {
|
|
39557
39846
|
reportOperationFailure(socket, command.requestId, "", error62);
|
|
39558
39847
|
}
|
|
@@ -39607,15 +39896,12 @@ async function executeSessionPrepare(publisher, socket, command, config2, direct
|
|
|
39607
39896
|
event: "session_configured",
|
|
39608
39897
|
sessionId: command.sessionId
|
|
39609
39898
|
});
|
|
39610
|
-
publisher.recordRuntime(
|
|
39611
|
-
|
|
39612
|
-
|
|
39613
|
-
|
|
39614
|
-
|
|
39615
|
-
|
|
39616
|
-
sessionId: command.sessionId
|
|
39617
|
-
})
|
|
39618
|
-
);
|
|
39899
|
+
publisher.recordRuntime(command.sessionId, {
|
|
39900
|
+
configOptions,
|
|
39901
|
+
kind: "session.config.updated",
|
|
39902
|
+
requestId: command.requestId,
|
|
39903
|
+
sessionId: command.sessionId
|
|
39904
|
+
});
|
|
39619
39905
|
}
|
|
39620
39906
|
const event = {
|
|
39621
39907
|
additionalDirectories: resolved.additionalDirectoryEntries,
|
|
@@ -39634,17 +39920,14 @@ async function executeSessionPrepare(publisher, socket, command, config2, direct
|
|
|
39634
39920
|
runtimeTimings: metrics.snapshot()
|
|
39635
39921
|
};
|
|
39636
39922
|
metrics.measureSync("readiness-commit", () => {
|
|
39637
|
-
publisher.recordRuntime(command.sessionId,
|
|
39923
|
+
publisher.recordRuntime(command.sessionId, event);
|
|
39638
39924
|
});
|
|
39639
39925
|
return event;
|
|
39640
39926
|
});
|
|
39641
|
-
send(
|
|
39642
|
-
|
|
39643
|
-
|
|
39644
|
-
|
|
39645
|
-
runtimeTimings: metrics.snapshot()
|
|
39646
|
-
})
|
|
39647
|
-
);
|
|
39927
|
+
send(socket, {
|
|
39928
|
+
...readyEvent,
|
|
39929
|
+
runtimeTimings: metrics.snapshot()
|
|
39930
|
+
});
|
|
39648
39931
|
} catch (error62) {
|
|
39649
39932
|
audit.record({
|
|
39650
39933
|
commandId: command.requestId,
|
|
@@ -39684,15 +39967,12 @@ async function executeSessionConfigure(publisher, socket, command, config2, dire
|
|
|
39684
39967
|
event: "session_configured",
|
|
39685
39968
|
sessionId: command.sessionId
|
|
39686
39969
|
});
|
|
39687
|
-
publisher.recordRuntime(
|
|
39688
|
-
|
|
39689
|
-
|
|
39690
|
-
|
|
39691
|
-
|
|
39692
|
-
|
|
39693
|
-
sessionId: command.sessionId
|
|
39694
|
-
})
|
|
39695
|
-
);
|
|
39970
|
+
publisher.recordRuntime(command.sessionId, {
|
|
39971
|
+
configOptions,
|
|
39972
|
+
kind: "session.config.updated",
|
|
39973
|
+
requestId: command.requestId,
|
|
39974
|
+
sessionId: command.sessionId
|
|
39975
|
+
});
|
|
39696
39976
|
} catch (error62) {
|
|
39697
39977
|
if (signal.aborted) {
|
|
39698
39978
|
signal.throwIfAborted();
|
|
@@ -39702,20 +39982,20 @@ async function executeSessionConfigure(publisher, socket, command, config2, dire
|
|
|
39702
39982
|
}
|
|
39703
39983
|
async function executePrompt(outbox, publisher, command, config2, directories, audit, sessions, attemptId, activateAttempt, timer, signal) {
|
|
39704
39984
|
const activities = new CoalescingDaemonActivityPublisher(timer, (activity) => {
|
|
39705
|
-
publisher.recordAttempt(command.sessionId,
|
|
39985
|
+
publisher.recordAttempt(command.sessionId, daemonActivity(command, activity), attemptId);
|
|
39706
39986
|
});
|
|
39707
39987
|
const text3 = new CoalescingTextPublisher(
|
|
39708
39988
|
timer,
|
|
39709
39989
|
(messageId, delta) => {
|
|
39710
39990
|
publisher.recordAttempt(
|
|
39711
39991
|
command.sessionId,
|
|
39712
|
-
|
|
39992
|
+
{
|
|
39713
39993
|
commandId: command.commandId,
|
|
39714
39994
|
kind: AGENT_MESSAGE_DELTA_KIND,
|
|
39715
39995
|
messageId,
|
|
39716
39996
|
sessionId: command.sessionId,
|
|
39717
39997
|
text: delta
|
|
39718
|
-
}
|
|
39998
|
+
},
|
|
39719
39999
|
attemptId
|
|
39720
40000
|
);
|
|
39721
40001
|
},
|
|
@@ -39774,12 +40054,12 @@ async function executePrompt(outbox, publisher, command, config2, directories, a
|
|
|
39774
40054
|
outbox.transitionExecution(command.commandId, "running");
|
|
39775
40055
|
publisher.recordAttempt(
|
|
39776
40056
|
command.sessionId,
|
|
39777
|
-
|
|
40057
|
+
{
|
|
39778
40058
|
commandId: command.commandId,
|
|
39779
40059
|
kind: SESSION_STARTED_KIND,
|
|
39780
40060
|
attemptId,
|
|
39781
40061
|
sessionId: command.sessionId
|
|
39782
|
-
}
|
|
40062
|
+
},
|
|
39783
40063
|
attemptId
|
|
39784
40064
|
);
|
|
39785
40065
|
activateAttempt();
|
|
@@ -39824,12 +40104,12 @@ async function executePrompt(outbox, publisher, command, config2, directories, a
|
|
|
39824
40104
|
activities.flush();
|
|
39825
40105
|
publisher.recordAttempt(
|
|
39826
40106
|
command.sessionId,
|
|
39827
|
-
|
|
40107
|
+
{
|
|
39828
40108
|
commandId: command.commandId,
|
|
39829
40109
|
kind: SESSION_COMPLETED_KIND,
|
|
39830
40110
|
sessionId: command.sessionId,
|
|
39831
40111
|
stopReason
|
|
39832
|
-
}
|
|
40112
|
+
},
|
|
39833
40113
|
attemptId
|
|
39834
40114
|
);
|
|
39835
40115
|
outbox.transitionExecution(command.commandId, stopReason === "cancelled" ? "cancelled" : "succeeded");
|
|
@@ -40253,9 +40533,10 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40253
40533
|
}
|
|
40254
40534
|
};
|
|
40255
40535
|
const processDeliveredPayload = async (delivery) => {
|
|
40256
|
-
const
|
|
40536
|
+
const message = decodeServiceToDaemonMessage(delivery.payload);
|
|
40537
|
+
const kind = message.kind;
|
|
40257
40538
|
if (kind === SESSION_CANCEL_KIND) {
|
|
40258
|
-
const cancellation =
|
|
40539
|
+
const cancellation = message;
|
|
40259
40540
|
if (cancellation.sessionId !== delivery.sessionId) {
|
|
40260
40541
|
throw new Error("Runtime delivery Session identity does not match its payload");
|
|
40261
40542
|
}
|
|
@@ -40272,7 +40553,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40272
40553
|
return;
|
|
40273
40554
|
}
|
|
40274
40555
|
if (kind === SESSION_CONFIGURE_KIND) {
|
|
40275
|
-
const command =
|
|
40556
|
+
const command = message;
|
|
40276
40557
|
if (command.sessionId !== delivery.sessionId) {
|
|
40277
40558
|
throw new Error("Runtime delivery Session identity does not match its payload");
|
|
40278
40559
|
}
|
|
@@ -40289,7 +40570,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40289
40570
|
return;
|
|
40290
40571
|
}
|
|
40291
40572
|
if (kind === SESSION_PERMISSION_RESPOND_KIND) {
|
|
40292
|
-
const command =
|
|
40573
|
+
const command = message;
|
|
40293
40574
|
if (command.sessionId !== delivery.sessionId) {
|
|
40294
40575
|
throw new Error("Runtime delivery Session identity does not match its payload");
|
|
40295
40576
|
}
|
|
@@ -40306,7 +40587,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40306
40587
|
return;
|
|
40307
40588
|
}
|
|
40308
40589
|
if (kind === SESSION_ELICITATION_RESPOND_KIND) {
|
|
40309
|
-
const command =
|
|
40590
|
+
const command = message;
|
|
40310
40591
|
if (command.sessionId !== delivery.sessionId) {
|
|
40311
40592
|
throw new Error("Runtime delivery Session identity does not match its payload");
|
|
40312
40593
|
}
|
|
@@ -40323,7 +40604,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40323
40604
|
return;
|
|
40324
40605
|
}
|
|
40325
40606
|
if (kind === SESSION_PROMPT_KIND) {
|
|
40326
|
-
const command =
|
|
40607
|
+
const command = message;
|
|
40327
40608
|
await processDeliveredPrompt(
|
|
40328
40609
|
delivery,
|
|
40329
40610
|
command,
|
|
@@ -40367,18 +40648,19 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40367
40648
|
}).finally(() => processingDeliveryIds.delete(delivery.deliveryId));
|
|
40368
40649
|
};
|
|
40369
40650
|
const receiveRuntimeDelivery = (delivery) => {
|
|
40370
|
-
const
|
|
40651
|
+
const payload = decodeServiceToDaemonMessage(delivery.payload);
|
|
40652
|
+
const payloadKind = payload.kind;
|
|
40371
40653
|
let payloadSessionId = "";
|
|
40372
40654
|
if (payloadKind === SESSION_CANCEL_KIND) {
|
|
40373
|
-
payloadSessionId =
|
|
40655
|
+
payloadSessionId = payload.sessionId;
|
|
40374
40656
|
} else if (payloadKind === SESSION_CONFIGURE_KIND) {
|
|
40375
|
-
payloadSessionId =
|
|
40657
|
+
payloadSessionId = payload.sessionId;
|
|
40376
40658
|
} else if (payloadKind === SESSION_PERMISSION_RESPOND_KIND) {
|
|
40377
|
-
payloadSessionId =
|
|
40659
|
+
payloadSessionId = payload.sessionId;
|
|
40378
40660
|
} else if (payloadKind === SESSION_ELICITATION_RESPOND_KIND) {
|
|
40379
|
-
payloadSessionId =
|
|
40661
|
+
payloadSessionId = payload.sessionId;
|
|
40380
40662
|
} else if (payloadKind === SESSION_PROMPT_KIND) {
|
|
40381
|
-
payloadSessionId =
|
|
40663
|
+
payloadSessionId = payload.sessionId;
|
|
40382
40664
|
} else {
|
|
40383
40665
|
throw new Error("Runtime delivery contains an unsupported protocol message");
|
|
40384
40666
|
}
|
|
@@ -40386,14 +40668,11 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40386
40668
|
throw new Error("Runtime delivery Session identity does not match its payload");
|
|
40387
40669
|
}
|
|
40388
40670
|
const stored = outbox.claimRuntimeDelivery(delivery);
|
|
40389
|
-
send(
|
|
40390
|
-
|
|
40391
|
-
|
|
40392
|
-
|
|
40393
|
-
|
|
40394
|
-
sessionId: delivery.sessionId
|
|
40395
|
-
})
|
|
40396
|
-
);
|
|
40671
|
+
send(socket, {
|
|
40672
|
+
deliveryId: delivery.deliveryId,
|
|
40673
|
+
kind: RUNTIME_DELIVERY_RECEIVED_KIND,
|
|
40674
|
+
sessionId: delivery.sessionId
|
|
40675
|
+
});
|
|
40397
40676
|
processRuntimeDelivery(delivery, stored.state);
|
|
40398
40677
|
};
|
|
40399
40678
|
const resumeRuntimeDeliveries = () => {
|
|
@@ -40405,14 +40684,11 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40405
40684
|
sessionId: stored.sessionId
|
|
40406
40685
|
};
|
|
40407
40686
|
if (stored.state !== "relay_committed") {
|
|
40408
|
-
send(
|
|
40409
|
-
|
|
40410
|
-
|
|
40411
|
-
|
|
40412
|
-
|
|
40413
|
-
sessionId: stored.sessionId
|
|
40414
|
-
})
|
|
40415
|
-
);
|
|
40687
|
+
send(socket, {
|
|
40688
|
+
deliveryId: stored.deliveryId,
|
|
40689
|
+
kind: RUNTIME_DELIVERY_RECEIVED_KIND,
|
|
40690
|
+
sessionId: stored.sessionId
|
|
40691
|
+
});
|
|
40416
40692
|
}
|
|
40417
40693
|
processRuntimeDelivery(delivery, stored.state);
|
|
40418
40694
|
}
|
|
@@ -40471,28 +40747,29 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40471
40747
|
return;
|
|
40472
40748
|
}
|
|
40473
40749
|
try {
|
|
40474
|
-
const
|
|
40750
|
+
const message = decodeServiceToDaemonMessage(encoded);
|
|
40751
|
+
const kind = message.kind;
|
|
40475
40752
|
if (kind === RUNTIME_DELIVERY_COMMITTED_KIND) {
|
|
40476
|
-
const committed =
|
|
40753
|
+
const committed = message;
|
|
40477
40754
|
if (!outbox.markRuntimeDeliveryCommitted(committed.deliveryId, committed.sessionId)) {
|
|
40478
40755
|
console.warn("Mobius daemon ignored confirmation for an unknown Runtime delivery");
|
|
40479
40756
|
}
|
|
40480
40757
|
return;
|
|
40481
40758
|
}
|
|
40482
40759
|
if (kind === RUNTIME_DELIVERY_KIND) {
|
|
40483
|
-
receiveRuntimeDelivery(
|
|
40760
|
+
receiveRuntimeDelivery(message);
|
|
40484
40761
|
return;
|
|
40485
40762
|
}
|
|
40486
40763
|
if (kind === SESSION_EVENT_ACK_KIND) {
|
|
40487
|
-
publisher.acknowledge(
|
|
40764
|
+
publisher.acknowledge(message);
|
|
40488
40765
|
return;
|
|
40489
40766
|
}
|
|
40490
40767
|
if (kind === SESSION_EVENT_DEFERRED_KIND) {
|
|
40491
|
-
publisher.defer(
|
|
40768
|
+
publisher.defer(message);
|
|
40492
40769
|
return;
|
|
40493
40770
|
}
|
|
40494
40771
|
if (kind === SESSION_EVENT_REJECTED_KIND) {
|
|
40495
|
-
const rejection =
|
|
40772
|
+
const rejection = message;
|
|
40496
40773
|
if (publisher.quarantine(rejection)) {
|
|
40497
40774
|
audit.record({
|
|
40498
40775
|
commandId: rejection.eventId,
|
|
@@ -40506,7 +40783,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40506
40783
|
return;
|
|
40507
40784
|
}
|
|
40508
40785
|
if (kind === NATIVE_SESSION_CANCEL_KIND) {
|
|
40509
|
-
const command2 =
|
|
40786
|
+
const command2 = message;
|
|
40510
40787
|
const pending = nativeRequests.get(command2.requestId);
|
|
40511
40788
|
if (pending?.sessionId === command2.sessionId) {
|
|
40512
40789
|
pending.controller.abort(
|
|
@@ -40520,35 +40797,29 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40520
40797
|
return;
|
|
40521
40798
|
}
|
|
40522
40799
|
if (kind === AGENT_SETTINGS_DISCOVER_KIND) {
|
|
40523
|
-
const command2 =
|
|
40800
|
+
const command2 = message;
|
|
40524
40801
|
const existing = [...agentSettingsDiscoveries.values()].find(
|
|
40525
40802
|
(request) => request.agentId === command2.agentId && !request.controller.signal.aborted
|
|
40526
40803
|
);
|
|
40527
40804
|
if (agentSettingsDiscoveries.has(command2.requestId) || existing !== void 0) {
|
|
40528
40805
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40529
|
-
send(
|
|
40530
|
-
|
|
40531
|
-
|
|
40532
|
-
|
|
40533
|
-
|
|
40534
|
-
|
|
40535
|
-
requestId: command2.requestId
|
|
40536
|
-
})
|
|
40537
|
-
);
|
|
40806
|
+
send(socket, {
|
|
40807
|
+
code: "agent_settings_discovery_busy",
|
|
40808
|
+
kind: AGENT_SETTINGS_DISCOVERY_FAILED_KIND,
|
|
40809
|
+
message: "Another settings discovery is already running for this Agent",
|
|
40810
|
+
requestId: command2.requestId
|
|
40811
|
+
});
|
|
40538
40812
|
}
|
|
40539
40813
|
return;
|
|
40540
40814
|
}
|
|
40541
40815
|
if (agentSettingsDiscoveries.size >= 4) {
|
|
40542
40816
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40543
|
-
send(
|
|
40544
|
-
|
|
40545
|
-
|
|
40546
|
-
|
|
40547
|
-
|
|
40548
|
-
|
|
40549
|
-
requestId: command2.requestId
|
|
40550
|
-
})
|
|
40551
|
-
);
|
|
40817
|
+
send(socket, {
|
|
40818
|
+
code: "agent_settings_discovery_busy",
|
|
40819
|
+
kind: AGENT_SETTINGS_DISCOVERY_FAILED_KIND,
|
|
40820
|
+
message: "Too many Agent settings discoveries are running",
|
|
40821
|
+
requestId: command2.requestId
|
|
40822
|
+
});
|
|
40552
40823
|
}
|
|
40553
40824
|
return;
|
|
40554
40825
|
}
|
|
@@ -40580,7 +40851,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40580
40851
|
sessionId: `agent-settings:${command2.agentId}`
|
|
40581
40852
|
});
|
|
40582
40853
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40583
|
-
send(socket,
|
|
40854
|
+
send(socket, result);
|
|
40584
40855
|
}
|
|
40585
40856
|
} catch (error62) {
|
|
40586
40857
|
const failure2 = operationSignal.aborted ? controller.signal.reason ?? new AcpExecutionError(
|
|
@@ -40595,15 +40866,12 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40595
40866
|
sessionId: `agent-settings:${command2.agentId}`
|
|
40596
40867
|
});
|
|
40597
40868
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40598
|
-
send(
|
|
40599
|
-
|
|
40600
|
-
|
|
40601
|
-
|
|
40602
|
-
|
|
40603
|
-
|
|
40604
|
-
requestId: command2.requestId
|
|
40605
|
-
})
|
|
40606
|
-
);
|
|
40869
|
+
send(socket, {
|
|
40870
|
+
code: operationErrorCode(failure2),
|
|
40871
|
+
kind: AGENT_SETTINGS_DISCOVERY_FAILED_KIND,
|
|
40872
|
+
message: operationErrorMessage(failure2),
|
|
40873
|
+
requestId: command2.requestId
|
|
40874
|
+
});
|
|
40607
40875
|
}
|
|
40608
40876
|
} finally {
|
|
40609
40877
|
timeout.cancel();
|
|
@@ -40618,18 +40886,15 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40618
40886
|
return;
|
|
40619
40887
|
}
|
|
40620
40888
|
if (kind === AGENT_CATALOG_REFRESH_KIND) {
|
|
40621
|
-
const command2 =
|
|
40889
|
+
const command2 = message;
|
|
40622
40890
|
if (agentCatalogRefreshes.has(command2.requestId) || agentCatalogRefreshes.size > 0) {
|
|
40623
40891
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40624
|
-
send(
|
|
40625
|
-
|
|
40626
|
-
|
|
40627
|
-
|
|
40628
|
-
|
|
40629
|
-
|
|
40630
|
-
requestId: command2.requestId
|
|
40631
|
-
})
|
|
40632
|
-
);
|
|
40892
|
+
send(socket, {
|
|
40893
|
+
code: "agent_catalog_refresh_busy",
|
|
40894
|
+
kind: AGENT_CATALOG_REFRESH_FAILED_KIND,
|
|
40895
|
+
message: "Another local Agent catalog refresh is already running",
|
|
40896
|
+
requestId: command2.requestId
|
|
40897
|
+
});
|
|
40633
40898
|
}
|
|
40634
40899
|
return;
|
|
40635
40900
|
}
|
|
@@ -40654,13 +40919,10 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40654
40919
|
sessionId: "agent-catalog"
|
|
40655
40920
|
});
|
|
40656
40921
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40657
|
-
send(
|
|
40658
|
-
|
|
40659
|
-
|
|
40660
|
-
|
|
40661
|
-
requestId: command2.requestId
|
|
40662
|
-
})
|
|
40663
|
-
);
|
|
40922
|
+
send(socket, {
|
|
40923
|
+
kind: AGENT_CATALOG_REFRESHED_KIND,
|
|
40924
|
+
requestId: command2.requestId
|
|
40925
|
+
});
|
|
40664
40926
|
}
|
|
40665
40927
|
} catch (error62) {
|
|
40666
40928
|
const failure2 = operationSignal.aborted ? controller.signal.reason ?? new AcpExecutionError(
|
|
@@ -40675,15 +40937,12 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40675
40937
|
sessionId: "agent-catalog"
|
|
40676
40938
|
});
|
|
40677
40939
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40678
|
-
send(
|
|
40679
|
-
|
|
40680
|
-
|
|
40681
|
-
|
|
40682
|
-
|
|
40683
|
-
|
|
40684
|
-
requestId: command2.requestId
|
|
40685
|
-
})
|
|
40686
|
-
);
|
|
40940
|
+
send(socket, {
|
|
40941
|
+
code: operationErrorCode(failure2),
|
|
40942
|
+
kind: AGENT_CATALOG_REFRESH_FAILED_KIND,
|
|
40943
|
+
message: operationErrorMessage(failure2),
|
|
40944
|
+
requestId: command2.requestId
|
|
40945
|
+
});
|
|
40687
40946
|
}
|
|
40688
40947
|
} finally {
|
|
40689
40948
|
timeout.cancel();
|
|
@@ -40694,7 +40953,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40694
40953
|
return;
|
|
40695
40954
|
}
|
|
40696
40955
|
if (kind === NATIVE_SESSION_REQUEST_KIND) {
|
|
40697
|
-
const command2 =
|
|
40956
|
+
const command2 = message;
|
|
40698
40957
|
const previous2 = [...nativeRequests.values()].filter(
|
|
40699
40958
|
(request) => request.agentId === command2.agentId
|
|
40700
40959
|
);
|
|
@@ -40747,7 +41006,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40747
41006
|
operationSignal.throwIfAborted();
|
|
40748
41007
|
const result = await nativeSessions.execute(command2, operationSignal);
|
|
40749
41008
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40750
|
-
send(socket,
|
|
41009
|
+
send(socket, result);
|
|
40751
41010
|
}
|
|
40752
41011
|
} catch (error62) {
|
|
40753
41012
|
const failure2 = operationSignal.aborted ? controller.signal.reason ?? new AcpExecutionError(
|
|
@@ -40776,7 +41035,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40776
41035
|
return;
|
|
40777
41036
|
}
|
|
40778
41037
|
if (kind === NATIVE_SESSION_TURN_FORK_KIND) {
|
|
40779
|
-
const command2 =
|
|
41038
|
+
const command2 = message;
|
|
40780
41039
|
const previous2 = [...nativeRequests.values()].filter(
|
|
40781
41040
|
(request) => request.agentId === command2.agentId
|
|
40782
41041
|
);
|
|
@@ -40827,7 +41086,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40827
41086
|
operationSignal.throwIfAborted();
|
|
40828
41087
|
const result = await nativeSessions.executeTurnFork(command2, operationSignal);
|
|
40829
41088
|
if (socket.readyState === WebSocket2.OPEN) {
|
|
40830
|
-
send(socket,
|
|
41089
|
+
send(socket, result);
|
|
40831
41090
|
}
|
|
40832
41091
|
} catch (error62) {
|
|
40833
41092
|
const failure2 = operationSignal.aborted ? controller.signal.reason ?? new AcpExecutionError(
|
|
@@ -40856,39 +41115,35 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40856
41115
|
return;
|
|
40857
41116
|
}
|
|
40858
41117
|
if (kind === RUNTIME_LIVENESS_READY_KIND) {
|
|
40859
|
-
decodeRuntimeLivenessReadyEvent(encoded);
|
|
40860
41118
|
connectionLiveness.start();
|
|
40861
41119
|
return;
|
|
40862
41120
|
}
|
|
40863
41121
|
if (kind === RUNTIME_HEARTBEAT_ACK_KIND) {
|
|
40864
|
-
connectionLiveness.acknowledge(
|
|
41122
|
+
connectionLiveness.acknowledge(message);
|
|
40865
41123
|
return;
|
|
40866
41124
|
}
|
|
40867
41125
|
if (kind === FILE_READ_KIND) {
|
|
40868
|
-
const command2 =
|
|
41126
|
+
const command2 = message;
|
|
40869
41127
|
void streamLocalFile(
|
|
40870
41128
|
command2,
|
|
40871
|
-
(
|
|
41129
|
+
(message2) => send(socket, message2),
|
|
40872
41130
|
connectionController.signal
|
|
40873
41131
|
).catch((error62) => {
|
|
40874
41132
|
if (socket.readyState !== WebSocket2.OPEN || connectionController.signal.aborted) {
|
|
40875
41133
|
return;
|
|
40876
41134
|
}
|
|
40877
|
-
send(
|
|
40878
|
-
|
|
40879
|
-
|
|
40880
|
-
|
|
40881
|
-
|
|
40882
|
-
|
|
40883
|
-
|
|
40884
|
-
sessionId: command2.sessionId
|
|
40885
|
-
})
|
|
40886
|
-
);
|
|
41135
|
+
send(socket, {
|
|
41136
|
+
code: "file_unavailable",
|
|
41137
|
+
kind: FILE_FAILED_KIND,
|
|
41138
|
+
message: error62 instanceof Error ? error62.message : "The local file is unavailable",
|
|
41139
|
+
requestId: command2.requestId,
|
|
41140
|
+
sessionId: command2.sessionId
|
|
41141
|
+
});
|
|
40887
41142
|
});
|
|
40888
41143
|
return;
|
|
40889
41144
|
}
|
|
40890
41145
|
if (kind === SESSION_CANCEL_KIND) {
|
|
40891
|
-
const cancellation =
|
|
41146
|
+
const cancellation = message;
|
|
40892
41147
|
const turn2 = activeTurns.get(cancellation.commandId);
|
|
40893
41148
|
if (turn2 === void 0 || !turn2.matches(cancellation)) {
|
|
40894
41149
|
console.warn("Mobius daemon ignored cancellation for an inactive turn");
|
|
@@ -40908,12 +41163,12 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40908
41163
|
return;
|
|
40909
41164
|
}
|
|
40910
41165
|
if (kind === WORKSPACE_LIST_KIND) {
|
|
40911
|
-
const command2 =
|
|
41166
|
+
const command2 = message;
|
|
40912
41167
|
void executeWorkspaceList(socket, command2, directories, audit, connectionController.signal);
|
|
40913
41168
|
return;
|
|
40914
41169
|
}
|
|
40915
41170
|
if (kind === SESSION_PREPARE_KIND) {
|
|
40916
|
-
const command2 =
|
|
41171
|
+
const command2 = message;
|
|
40917
41172
|
void executeSessionPrepare(
|
|
40918
41173
|
publisher,
|
|
40919
41174
|
socket,
|
|
@@ -40927,7 +41182,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40927
41182
|
return;
|
|
40928
41183
|
}
|
|
40929
41184
|
if (kind === SESSION_CONFIGURE_KIND) {
|
|
40930
|
-
const command2 =
|
|
41185
|
+
const command2 = message;
|
|
40931
41186
|
void executeSessionConfigure(
|
|
40932
41187
|
publisher,
|
|
40933
41188
|
socket,
|
|
@@ -40941,7 +41196,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40941
41196
|
return;
|
|
40942
41197
|
}
|
|
40943
41198
|
if (kind === SESSION_PERMISSION_RESPOND_KIND) {
|
|
40944
|
-
const command2 =
|
|
41199
|
+
const command2 = message;
|
|
40945
41200
|
void sessions.respondPermission(command2).then(() => {
|
|
40946
41201
|
audit.record({
|
|
40947
41202
|
commandId: command2.interactionId,
|
|
@@ -40954,7 +41209,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40954
41209
|
return;
|
|
40955
41210
|
}
|
|
40956
41211
|
if (kind === SESSION_ELICITATION_RESPOND_KIND) {
|
|
40957
|
-
const command2 =
|
|
41212
|
+
const command2 = message;
|
|
40958
41213
|
void sessions.respondElicitation(command2).then(() => {
|
|
40959
41214
|
audit.record({
|
|
40960
41215
|
commandId: command2.interactionId,
|
|
@@ -40967,14 +41222,14 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40967
41222
|
return;
|
|
40968
41223
|
}
|
|
40969
41224
|
if (kind === AGENT_INSTALL_REQUEST_KIND) {
|
|
40970
|
-
const command2 =
|
|
41225
|
+
const command2 = message;
|
|
40971
41226
|
void installations.request(command2, signal).catch((error62) => {
|
|
40972
41227
|
console.error("Mobius Agent integration installation failed", error62);
|
|
40973
41228
|
});
|
|
40974
41229
|
return;
|
|
40975
41230
|
}
|
|
40976
41231
|
if (kind === AGENT_INSTALL_CANCEL_KIND) {
|
|
40977
|
-
const command2 =
|
|
41232
|
+
const command2 = message;
|
|
40978
41233
|
void installations.cancel(command2.requestId).catch((error62) => {
|
|
40979
41234
|
reportOperationFailure(socket, command2.requestId, "", error62);
|
|
40980
41235
|
});
|
|
@@ -40983,7 +41238,7 @@ async function runRelayConnection(config2, directories, audit, sessions, install
|
|
|
40983
41238
|
if (kind !== SESSION_PROMPT_KIND) {
|
|
40984
41239
|
throw new Error("Unsupported protocol message");
|
|
40985
41240
|
}
|
|
40986
|
-
const command =
|
|
41241
|
+
const command = message;
|
|
40987
41242
|
if (activeTurns.has(command.commandId)) {
|
|
40988
41243
|
return;
|
|
40989
41244
|
}
|
|
@@ -41104,13 +41359,13 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer, opti
|
|
|
41104
41359
|
const publisher = new DaemonSessionEventPublisher(outbox, timer);
|
|
41105
41360
|
const activeTurns = /* @__PURE__ */ new Map();
|
|
41106
41361
|
const activeAttemptIds = /* @__PURE__ */ new Map();
|
|
41107
|
-
const recordSessionEvent = (sessionId,
|
|
41362
|
+
const recordSessionEvent = (sessionId, event) => {
|
|
41108
41363
|
const attemptId = activeAttemptIds.get(sessionId);
|
|
41109
41364
|
if (attemptId === void 0) {
|
|
41110
|
-
publisher.recordRuntime(sessionId,
|
|
41365
|
+
publisher.recordRuntime(sessionId, event);
|
|
41111
41366
|
return;
|
|
41112
41367
|
}
|
|
41113
|
-
publisher.recordAttempt(sessionId,
|
|
41368
|
+
publisher.recordAttempt(sessionId, event, attemptId);
|
|
41114
41369
|
};
|
|
41115
41370
|
const sessions = new AcpSessionManager(new DaemonAcpObserver(config2, recordSessionEvent), sessionStore);
|
|
41116
41371
|
const directories = new WorkspaceDirectoryService(config2.bindingId, config2.defaultWorkspace);
|
|
@@ -41340,7 +41595,7 @@ var ImportedLegacyRuntimeConnection = class extends StoredRuntimeConnection {
|
|
|
41340
41595
|
super(applicationId, installationId2, connectionId2, channelId, defaultWorkspace, relayOrigin, runtimeCredential2);
|
|
41341
41596
|
}
|
|
41342
41597
|
};
|
|
41343
|
-
function
|
|
41598
|
+
function isRecord10(value) {
|
|
41344
41599
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41345
41600
|
}
|
|
41346
41601
|
function hasExactKeys(value, expectedKeys) {
|
|
@@ -41407,7 +41662,7 @@ function channelIndexFileName(channelId) {
|
|
|
41407
41662
|
return `mci_${createHash5("sha256").update(channelId).digest("hex")}.json`;
|
|
41408
41663
|
}
|
|
41409
41664
|
function decodeInstallationPointer(value) {
|
|
41410
|
-
if (!
|
|
41665
|
+
if (!isRecord10(value) || !hasExactKeys(value, INSTALLATION_POINTER_KEYS) || value["version"] !== 1) {
|
|
41411
41666
|
throw new RuntimeInstallationStoreError("invalid_installation", "The local installation record is invalid");
|
|
41412
41667
|
}
|
|
41413
41668
|
const storedInstallationId = value["installationId"];
|
|
@@ -41417,7 +41672,7 @@ function decodeInstallationPointer(value) {
|
|
|
41417
41672
|
return { installationId: validateInstallationId(storedInstallationId) };
|
|
41418
41673
|
}
|
|
41419
41674
|
function decodeChannelIndex(value) {
|
|
41420
|
-
if (!
|
|
41675
|
+
if (!isRecord10(value) || !hasExactKeys(value, CHANNEL_INDEX_KEYS) || value["version"] !== 1) {
|
|
41421
41676
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
41422
41677
|
}
|
|
41423
41678
|
const applicationId = value["applicationId"];
|
|
@@ -41485,7 +41740,7 @@ function decodeImportedLegacyConnection(value) {
|
|
|
41485
41740
|
);
|
|
41486
41741
|
}
|
|
41487
41742
|
function decodeConnection(value) {
|
|
41488
|
-
if (!
|
|
41743
|
+
if (!isRecord10(value)) {
|
|
41489
41744
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
41490
41745
|
}
|
|
41491
41746
|
if (value["kind"] === "verified") {
|
|
@@ -41497,7 +41752,7 @@ function decodeConnection(value) {
|
|
|
41497
41752
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
41498
41753
|
}
|
|
41499
41754
|
function decodeLegacyConnection(value, expectedChannelId) {
|
|
41500
|
-
if (!
|
|
41755
|
+
if (!isRecord10(value) || !hasExactKeys(value, CURRENT_CONNECTION_KEYS) && !hasExactKeys(value, LEGACY_CONNECTION_KEYS)) {
|
|
41501
41756
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
41502
41757
|
}
|
|
41503
41758
|
const channelId = value["channelId"];
|
|
@@ -41797,7 +42052,7 @@ var PairingClientError = class extends Error {
|
|
|
41797
42052
|
this.name = "PairingClientError";
|
|
41798
42053
|
}
|
|
41799
42054
|
};
|
|
41800
|
-
function
|
|
42055
|
+
function isRecord11(value) {
|
|
41801
42056
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
41802
42057
|
}
|
|
41803
42058
|
function hasExactKeys2(value, expectedKeys) {
|
|
@@ -41875,9 +42130,9 @@ async function readJsonResponse(response) {
|
|
|
41875
42130
|
}
|
|
41876
42131
|
}
|
|
41877
42132
|
function readRelayError(value) {
|
|
41878
|
-
if (
|
|
42133
|
+
if (isRecord11(value)) {
|
|
41879
42134
|
const error62 = value["error"];
|
|
41880
|
-
if (
|
|
42135
|
+
if (isRecord11(error62)) {
|
|
41881
42136
|
const code = error62["code"];
|
|
41882
42137
|
const message = error62["message"];
|
|
41883
42138
|
if (typeof code === "string" && typeof message === "string") {
|
|
@@ -41888,7 +42143,7 @@ function readRelayError(value) {
|
|
|
41888
42143
|
return new PairingClientError("pairing_failed", "The relay could not pair this machine");
|
|
41889
42144
|
}
|
|
41890
42145
|
function decodePairingResponse(value, credentialField, expectedKeys) {
|
|
41891
|
-
if (!
|
|
42146
|
+
if (!isRecord11(value) || !hasExactKeys2(value, expectedKeys)) {
|
|
41892
42147
|
throw new PairingClientError("invalid_relay_response", "The relay returned an invalid pairing response");
|
|
41893
42148
|
}
|
|
41894
42149
|
const channelId = value["channelId"];
|