@moxt-ai/mobius 0.0.338 → 0.0.339
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/cli.js +60 -183
- package/dist/cli.js.map +3 -3
- package/dist/runtime.js +53 -175
- package/dist/runtime.js.map +3 -3
- package/dist/session/live/session-configurations.d.ts.map +1 -1
- package/dist/session/live/session-configurations.js +10 -12
- package/dist/session/live/session-configurations.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -2086,7 +2086,7 @@ var init_package = __esm({
|
|
|
2086
2086
|
"package.json"() {
|
|
2087
2087
|
package_default = {
|
|
2088
2088
|
name: "@moxt-ai/mobius",
|
|
2089
|
-
version: "0.0.
|
|
2089
|
+
version: "0.0.339",
|
|
2090
2090
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
2091
2091
|
type: "module",
|
|
2092
2092
|
bin: {
|
|
@@ -74671,83 +74671,6 @@ var init_interactions = __esm({
|
|
|
74671
74671
|
function isRecord4(value) {
|
|
74672
74672
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
74673
74673
|
}
|
|
74674
|
-
function hasUnknownDiscriminator(value, key, known) {
|
|
74675
|
-
if (!isRecord4(value)) {
|
|
74676
|
-
return false;
|
|
74677
|
-
}
|
|
74678
|
-
const variant = value[key];
|
|
74679
|
-
return typeof variant === "string" && !known.has(variant);
|
|
74680
|
-
}
|
|
74681
|
-
function containsUnknownContentBlock(value) {
|
|
74682
|
-
return hasUnknownDiscriminator(value, "type", knownContentBlockTypes);
|
|
74683
|
-
}
|
|
74684
|
-
function containsUnknownToolCallContent(value) {
|
|
74685
|
-
if (hasUnknownDiscriminator(value, "type", knownToolCallContentTypes)) {
|
|
74686
|
-
return true;
|
|
74687
|
-
}
|
|
74688
|
-
return isRecord4(value) && value["type"] === "content" && containsUnknownContentBlock(value["content"]);
|
|
74689
|
-
}
|
|
74690
|
-
function arrayContainsUnknown(value, predicate) {
|
|
74691
|
-
return Array.isArray(value) && value.some(predicate);
|
|
74692
|
-
}
|
|
74693
|
-
function containsUnknownAcpVariant(payload) {
|
|
74694
|
-
const update = payload["sessionUpdate"];
|
|
74695
|
-
if (typeof update !== "string") {
|
|
74696
|
-
return false;
|
|
74697
|
-
}
|
|
74698
|
-
if (!knownSessionUpdates.has(update)) {
|
|
74699
|
-
return true;
|
|
74700
|
-
}
|
|
74701
|
-
if (["user_message_chunk", "agent_message_chunk", "agent_thought_chunk", "compaction_summary_chunk"].includes(
|
|
74702
|
-
update
|
|
74703
|
-
)) {
|
|
74704
|
-
return containsUnknownContentBlock(payload["content"]);
|
|
74705
|
-
}
|
|
74706
|
-
if (update === "tool_call" || update === "tool_call_update") {
|
|
74707
|
-
return arrayContainsUnknown(payload["content"], containsUnknownToolCallContent);
|
|
74708
|
-
}
|
|
74709
|
-
if (update === "plan_update") {
|
|
74710
|
-
return hasUnknownDiscriminator(payload["plan"], "type", knownPlanTypes);
|
|
74711
|
-
}
|
|
74712
|
-
if (update === "config_option_update") {
|
|
74713
|
-
return arrayContainsUnknown(
|
|
74714
|
-
payload["configOptions"],
|
|
74715
|
-
(option) => hasUnknownDiscriminator(option, "type", knownConfigOptionTypes)
|
|
74716
|
-
);
|
|
74717
|
-
}
|
|
74718
|
-
if (update === "compaction_update") {
|
|
74719
|
-
return arrayContainsUnknown(payload["summary"], containsUnknownContentBlock);
|
|
74720
|
-
}
|
|
74721
|
-
return false;
|
|
74722
|
-
}
|
|
74723
|
-
function isKnownSessionEventVariant(value) {
|
|
74724
|
-
if (!isRecord4(value)) {
|
|
74725
|
-
return true;
|
|
74726
|
-
}
|
|
74727
|
-
const type = value["type"];
|
|
74728
|
-
if (typeof type !== "string") {
|
|
74729
|
-
return true;
|
|
74730
|
-
}
|
|
74731
|
-
if (type === "acp") {
|
|
74732
|
-
const payload = value["payload"];
|
|
74733
|
-
return !isRecord4(payload) || !containsUnknownAcpVariant(payload);
|
|
74734
|
-
}
|
|
74735
|
-
if (type === "lifecycle-metadata") {
|
|
74736
|
-
const payload = value["payload"];
|
|
74737
|
-
if (!isRecord4(payload)) {
|
|
74738
|
-
return true;
|
|
74739
|
-
}
|
|
74740
|
-
const kind = payload["kind"];
|
|
74741
|
-
if (typeof kind === "string" && !knownLifecycleKinds.has(kind)) {
|
|
74742
|
-
return false;
|
|
74743
|
-
}
|
|
74744
|
-
return kind !== "prompt.requested" || !arrayContainsUnknown(payload["content"], containsUnknownContentBlock);
|
|
74745
|
-
}
|
|
74746
|
-
return false;
|
|
74747
|
-
}
|
|
74748
|
-
function filterKnownSessionEventVariants(events) {
|
|
74749
|
-
return Array.isArray(events) ? events.filter(isKnownSessionEventVariant) : events;
|
|
74750
|
-
}
|
|
74751
74674
|
function inputValue(value) {
|
|
74752
74675
|
if (typeof value !== "string") {
|
|
74753
74676
|
return value;
|
|
@@ -74770,7 +74693,13 @@ function decode3(value, schema) {
|
|
|
74770
74693
|
function encode3(value, schema) {
|
|
74771
74694
|
return JSON.stringify(decode3(value, schema));
|
|
74772
74695
|
}
|
|
74773
|
-
function
|
|
74696
|
+
function decodedEntries(value, schema, maximum) {
|
|
74697
|
+
return Array.isArray(value) && value.length <= maximum ? value.flatMap((entry) => {
|
|
74698
|
+
const decoded = schema.safeParse(entry);
|
|
74699
|
+
return decoded.success ? [decoded.data] : [];
|
|
74700
|
+
}) : value;
|
|
74701
|
+
}
|
|
74702
|
+
function sanitizeConsumableNativeSessionEvents(value) {
|
|
74774
74703
|
const input2 = inputValue(value);
|
|
74775
74704
|
if (!isRecord4(input2)) {
|
|
74776
74705
|
return input2;
|
|
@@ -74779,13 +74708,15 @@ function sanitizeKnownNativeSessionEvents(value) {
|
|
|
74779
74708
|
const queuedPromptRequests = input2["queuedPromptRequests"];
|
|
74780
74709
|
return {
|
|
74781
74710
|
...input2,
|
|
74782
|
-
events: isRecord4(page) ? { ...page, events:
|
|
74783
|
-
queuedPromptRequests:
|
|
74784
|
-
|
|
74785
|
-
|
|
74711
|
+
events: isRecord4(page) ? { ...page, events: decodedEntries(page["events"], sessionEventSchema, MAX_EVENT_COUNT) } : page,
|
|
74712
|
+
queuedPromptRequests: decodedEntries(
|
|
74713
|
+
queuedPromptRequests,
|
|
74714
|
+
queuedPromptRequestEventLogSchema,
|
|
74715
|
+
MAX_COLLECTION_SIZE2
|
|
74716
|
+
)
|
|
74786
74717
|
};
|
|
74787
74718
|
}
|
|
74788
|
-
var MAX_EVENT_COUNT, MAX_COLLECTION_SIZE2, MAX_CONTENT_LENGTH2, SESSION_EVENT_KIND, SESSION_EVENT_BATCH_MAX_SIZE, boundedString2, shortString, externalContentKeySchema, annotationsSchema, contentFields, textContentSchema, imageContentSchema, audioContentSchema, externalImageContentSchema, externalAudioContentSchema, externalResourceContentSchema, resourceLinkSchema, textResourceSchema, blobResourceSchema, embeddedResourceSchema, contentBlockSchema, toolCallContentSchema, toolKindSchema, toolStatusSchema, backgroundTaskSchema, toolPatchFields, planEntrySchema, planContentSchema, commandSchema, configSelectOptionSchema, configSelectGroupSchema, configBaseFields, sessionConfigOptionSchema2, contentChunkFields, acpSessionUpdateSchema, lifecycleBase, promptExecutionContextSchema, lifecycleMetadataSchema, sessionEventPayloadSchema, positionSchema, sharedSessionEventFields, sessionLiveEventFields, sessionEventSchema, sessionLiveEventSchema, wireLifecyclePayloadSchema, wireEventFields, sessionWireEventSchema, sessionWireEnvelopeSchema,
|
|
74719
|
+
var MAX_EVENT_COUNT, MAX_COLLECTION_SIZE2, MAX_CONTENT_LENGTH2, SESSION_EVENT_KIND, SESSION_EVENT_BATCH_MAX_SIZE, boundedString2, shortString, externalContentKeySchema, annotationsSchema, contentFields, textContentSchema, imageContentSchema, audioContentSchema, externalImageContentSchema, externalAudioContentSchema, externalResourceContentSchema, resourceLinkSchema, textResourceSchema, blobResourceSchema, embeddedResourceSchema, contentBlockSchema, toolCallContentSchema, toolKindSchema, toolStatusSchema, backgroundTaskSchema, toolPatchFields, planEntrySchema, planContentSchema, commandSchema, configSelectOptionSchema, configSelectGroupSchema, configBaseFields, sessionConfigOptionSchema2, contentChunkFields, acpSessionUpdateSchema, lifecycleBase, promptExecutionContextSchema, lifecycleMetadataSchema, sessionEventPayloadSchema, positionSchema, sharedSessionEventFields, sessionLiveEventFields, sessionEventSchema, sessionLiveEventSchema, wireLifecyclePayloadSchema, wireEventFields, sessionWireEventSchema, sessionWireEnvelopeSchema, sessionEventBatchSchema, sessionLiveEventBatchSchema, sessionExportSchema, mobiusSessionExportSchema, sessionEventEnvelopeSchema, sessionEventLogPageSchema, sessionEventOmissionSchema, nativeEventPageRequestSchema, queuedPromptRequestEventLogSchema, nativeSessionEventsSchema, knownSessionLiveEventBatchSchema, decodeSessionEvent, decodeKnownSessionEventPayload, decodeSessionEventEnvelope, encodeSessionEventEnvelope, decodeAcpSessionUpdate, decodeKnownNativeSessionEvents;
|
|
74789
74720
|
var init_events = __esm({
|
|
74790
74721
|
"../mobius-sdk/src/protocol/session/events/index.ts"() {
|
|
74791
74722
|
"use strict";
|
|
@@ -75128,48 +75059,6 @@ var init_events = __esm({
|
|
|
75128
75059
|
kind: external_exports.literal(SESSION_EVENT_KIND),
|
|
75129
75060
|
events: external_exports.array(sessionWireEventSchema).min(1).max(SESSION_EVENT_BATCH_MAX_SIZE).readonly()
|
|
75130
75061
|
}).passthrough().readonly();
|
|
75131
|
-
knownContentBlockTypes = /* @__PURE__ */ new Set([
|
|
75132
|
-
"text",
|
|
75133
|
-
"image",
|
|
75134
|
-
"audio",
|
|
75135
|
-
"resource_link",
|
|
75136
|
-
"resource",
|
|
75137
|
-
"external_image",
|
|
75138
|
-
"external_audio",
|
|
75139
|
-
"external_resource"
|
|
75140
|
-
]);
|
|
75141
|
-
knownToolCallContentTypes = /* @__PURE__ */ new Set(["content", "diff", "terminal"]);
|
|
75142
|
-
knownPlanTypes = /* @__PURE__ */ new Set(["items", "file", "markdown"]);
|
|
75143
|
-
knownConfigOptionTypes = /* @__PURE__ */ new Set(["select", "boolean"]);
|
|
75144
|
-
knownSessionUpdates = /* @__PURE__ */ new Set([
|
|
75145
|
-
"user_message_chunk",
|
|
75146
|
-
"agent_message_chunk",
|
|
75147
|
-
"agent_thought_chunk",
|
|
75148
|
-
"tool_call",
|
|
75149
|
-
"tool_call_update",
|
|
75150
|
-
"plan",
|
|
75151
|
-
"plan_update",
|
|
75152
|
-
"plan_removed",
|
|
75153
|
-
"available_commands_update",
|
|
75154
|
-
"current_mode_update",
|
|
75155
|
-
"config_option_update",
|
|
75156
|
-
"session_info_update",
|
|
75157
|
-
"usage_update",
|
|
75158
|
-
"compaction_update",
|
|
75159
|
-
"compaction_summary_chunk"
|
|
75160
|
-
]);
|
|
75161
|
-
knownLifecycleKinds = /* @__PURE__ */ new Set([
|
|
75162
|
-
"session.queue.changed",
|
|
75163
|
-
"session.permission.requested",
|
|
75164
|
-
"session.permission.resolved",
|
|
75165
|
-
"session.elicitation.requested",
|
|
75166
|
-
"session.elicitation.resolved",
|
|
75167
|
-
"prompt.requested",
|
|
75168
|
-
"prompt.started",
|
|
75169
|
-
"prompt.completed",
|
|
75170
|
-
"prompt.failed-before-start",
|
|
75171
|
-
"prompt.failed"
|
|
75172
|
-
]);
|
|
75173
75062
|
sessionEventBatchSchema = external_exports.array(sessionEventSchema).min(1).max(SESSION_EVENT_BATCH_MAX_SIZE).readonly();
|
|
75174
75063
|
sessionLiveEventBatchSchema = external_exports.array(sessionLiveEventSchema).min(1).max(SESSION_EVENT_BATCH_MAX_SIZE).readonly();
|
|
75175
75064
|
sessionExportSchema = external_exports.object({
|
|
@@ -75235,11 +75124,14 @@ var init_events = __esm({
|
|
|
75235
75124
|
}).readonly();
|
|
75236
75125
|
knownSessionLiveEventBatchSchema = external_exports.array(sessionLiveEventSchema).max(SESSION_EVENT_BATCH_MAX_SIZE).readonly();
|
|
75237
75126
|
decodeSessionEvent = (value) => decode3(value, sessionEventSchema);
|
|
75238
|
-
decodeKnownSessionEventPayload = (value) =>
|
|
75127
|
+
decodeKnownSessionEventPayload = (value) => {
|
|
75128
|
+
const decoded = sessionEventPayloadSchema.safeParse(inputValue(value));
|
|
75129
|
+
return decoded.success ? decoded.data : null;
|
|
75130
|
+
};
|
|
75239
75131
|
decodeSessionEventEnvelope = (value) => decode3(value, sessionEventEnvelopeSchema);
|
|
75240
75132
|
encodeSessionEventEnvelope = (value) => encode3(value, sessionEventEnvelopeSchema);
|
|
75241
75133
|
decodeAcpSessionUpdate = (value) => decode3(value, acpSessionUpdateSchema);
|
|
75242
|
-
decodeKnownNativeSessionEvents = (value) => decode3(
|
|
75134
|
+
decodeKnownNativeSessionEvents = (value) => decode3(sanitizeConsumableNativeSessionEvents(value), nativeSessionEventsSchema);
|
|
75243
75135
|
}
|
|
75244
75136
|
});
|
|
75245
75137
|
|
|
@@ -76154,7 +76046,7 @@ var init_recording = __esm({
|
|
|
76154
76046
|
});
|
|
76155
76047
|
|
|
76156
76048
|
// ../mobius-sdk/src/protocol/session/recording/turn-history.ts
|
|
76157
|
-
var SESSION_RECORDING_TURN_PAGE_DECODE_MAX_ELEMENTS, SESSION_RECORDING_TURN_ITEM_ID_MAX_LENGTH, isoTimestamp, shortText, itemText, turnCursorSchema, turnItemCursorSchema, attemptTiming, promptSucceededOutcome, promptCancelledOutcome, promptFailedOutcome, sessionRecordingTurnAttemptSchema, turnItemBase, textItemFields, sessionRecordingToolDetailSchema, sessionRecordingTurnItemSchema, sessionRecordingTurnPromptSchema, sessionRecordingTurnPrecedingSchema, sessionRecordingTurnSchema, sessionRecordingInteractionSchema, SESSION_RECORDING_EXECUTION_COMMAND_MAX_LIMIT, recordingActiveCommandsSchema, sessionRecordingExecutionSchema, sessionRecordingTurnPageSchema, sessionRecordingTurnItemPageSchema, sessionRecordingTurnItemDetailSchema;
|
|
76049
|
+
var SESSION_RECORDING_TURN_PAGE_DECODE_MAX_ELEMENTS, SESSION_RECORDING_TURN_ITEM_ID_MAX_LENGTH, isoTimestamp, shortText, itemText, turnCursorSchema, turnItemCursorSchema, attemptTiming, promptSucceededOutcome, promptCancelledOutcome, promptFailedOutcome, sessionRecordingTurnAttemptSchema, turnItemBase, textItemFields, sessionRecordingToolDetailSchema, sessionRecordingTurnItemSchema, sessionRecordingTurnPromptSchema, sessionRecordingTurnPrecedingSchema, sessionRecordingTurnSchema, sessionRecordingInteractionSchema, SESSION_RECORDING_EXECUTION_COMMAND_MAX_LIMIT, recordingActiveCommandsSchema, sessionRecordingExecutionCommandSchema, sessionRecordingExecutionSchema, sessionRecordingTurnPageSchema, sessionRecordingTurnItemPageSchema, sessionRecordingTurnItemDetailSchema;
|
|
76158
76050
|
var init_turn_history = __esm({
|
|
76159
76051
|
"../mobius-sdk/src/protocol/session/recording/turn-history.ts"() {
|
|
76160
76052
|
"use strict";
|
|
@@ -76286,15 +76178,14 @@ var init_turn_history = __esm({
|
|
|
76286
76178
|
commandIds: external_exports.array(identifierStringSchema).max(1e3).readonly(),
|
|
76287
76179
|
generationId: identifierStringSchema
|
|
76288
76180
|
}).readonly().nullable();
|
|
76181
|
+
sessionRecordingExecutionCommandSchema = external_exports.object({
|
|
76182
|
+
attempt: sessionRecordingTurnAttemptSchema,
|
|
76183
|
+
commandId: identifierStringSchema,
|
|
76184
|
+
generationId: identifierStringSchema
|
|
76185
|
+
}).readonly();
|
|
76289
76186
|
sessionRecordingExecutionSchema = external_exports.object({
|
|
76290
76187
|
activeCommands: recordingActiveCommandsSchema,
|
|
76291
|
-
commands: external_exports.array(
|
|
76292
|
-
external_exports.object({
|
|
76293
|
-
attempt: sessionRecordingTurnAttemptSchema,
|
|
76294
|
-
commandId: identifierStringSchema,
|
|
76295
|
-
generationId: identifierStringSchema
|
|
76296
|
-
}).readonly()
|
|
76297
|
-
).max(SESSION_RECORDING_EXECUTION_COMMAND_MAX_LIMIT).readonly(),
|
|
76188
|
+
commands: external_exports.array(sessionRecordingExecutionCommandSchema).max(SESSION_RECORDING_EXECUTION_COMMAND_MAX_LIMIT).readonly(),
|
|
76298
76189
|
sessionId: identifierStringSchema,
|
|
76299
76190
|
tailCursor: recordingCursorSchema,
|
|
76300
76191
|
version: external_exports.literal(1)
|
|
@@ -76500,32 +76391,22 @@ function defineMessageSignature(kind, encoder, decoder) {
|
|
|
76500
76391
|
schema
|
|
76501
76392
|
};
|
|
76502
76393
|
}
|
|
76503
|
-
function isRecord5(value) {
|
|
76504
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
76505
|
-
}
|
|
76506
|
-
function hasUnknownDiscriminator2(value, key, known) {
|
|
76507
|
-
if (!isRecord5(value)) {
|
|
76508
|
-
return false;
|
|
76509
|
-
}
|
|
76510
|
-
const variant = value[key];
|
|
76511
|
-
return typeof variant === "string" && !known.has(variant);
|
|
76512
|
-
}
|
|
76513
|
-
function hasUnknownServiceVariant(kind, value) {
|
|
76514
|
-
return kind === NATIVE_SESSION_REQUEST_KIND && hasUnknownDiscriminator2(value, "action", knownNativeActions);
|
|
76515
|
-
}
|
|
76516
76394
|
function decodeKnownServiceToDaemonMessage(encoded) {
|
|
76517
76395
|
const kind = decodeMessageKind(encoded);
|
|
76518
76396
|
const signature = serviceToDaemonRegistry[kind];
|
|
76519
76397
|
if (signature === void 0) {
|
|
76520
76398
|
return null;
|
|
76521
76399
|
}
|
|
76522
|
-
|
|
76523
|
-
|
|
76400
|
+
try {
|
|
76401
|
+
return signature.decoder(encoded);
|
|
76402
|
+
} catch {
|
|
76403
|
+
return null;
|
|
76404
|
+
}
|
|
76524
76405
|
}
|
|
76525
76406
|
function encodeDaemonToServiceMessage(message) {
|
|
76526
76407
|
return daemonToServiceSignatures[message.kind].encoder(message);
|
|
76527
76408
|
}
|
|
76528
|
-
var serviceToDaemonSignatures, serviceToDaemonRegistry,
|
|
76409
|
+
var serviceToDaemonSignatures, serviceToDaemonRegistry, daemonToServiceSignatures;
|
|
76529
76410
|
var init_daemon_transport = __esm({
|
|
76530
76411
|
"../mobius-sdk/src/protocol/transport/daemon-transport.ts"() {
|
|
76531
76412
|
"use strict";
|
|
@@ -76676,7 +76557,6 @@ var init_daemon_transport = __esm({
|
|
|
76676
76557
|
)
|
|
76677
76558
|
};
|
|
76678
76559
|
serviceToDaemonRegistry = serviceToDaemonSignatures;
|
|
76679
|
-
knownNativeActions = /* @__PURE__ */ new Set(["active-turn", "find", "list", "import", "fork"]);
|
|
76680
76560
|
daemonToServiceSignatures = {
|
|
76681
76561
|
[SESSION_CLOSED_KIND]: defineMessageSignature(
|
|
76682
76562
|
SESSION_CLOSED_KIND,
|
|
@@ -82656,7 +82536,7 @@ var init_native_session = __esm({
|
|
|
82656
82536
|
|
|
82657
82537
|
// src/acp/protocol/session-config-protocol.ts
|
|
82658
82538
|
import { methods as methods9 } from "@agentclientprotocol/sdk";
|
|
82659
|
-
function
|
|
82539
|
+
function isRecord5(value) {
|
|
82660
82540
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
82661
82541
|
}
|
|
82662
82542
|
function readString3(value, fallback = "") {
|
|
@@ -82687,7 +82567,7 @@ function normalizeConfigValues(value) {
|
|
|
82687
82567
|
}
|
|
82688
82568
|
const normalized = [];
|
|
82689
82569
|
for (const entry of value) {
|
|
82690
|
-
if (!
|
|
82570
|
+
if (!isRecord5(entry)) {
|
|
82691
82571
|
continue;
|
|
82692
82572
|
}
|
|
82693
82573
|
const groupedOptions = entry["options"];
|
|
@@ -82695,7 +82575,7 @@ function normalizeConfigValues(value) {
|
|
|
82695
82575
|
const groupId = readString3(entry["group"]);
|
|
82696
82576
|
const groupName = readString3(entry["name"]);
|
|
82697
82577
|
for (const groupedOption of groupedOptions) {
|
|
82698
|
-
if (
|
|
82578
|
+
if (isRecord5(groupedOption)) {
|
|
82699
82579
|
const normalizedValue = normalizeConfigValue(groupedOption, groupId, groupName);
|
|
82700
82580
|
if (normalizedValue !== void 0) {
|
|
82701
82581
|
normalized.push(normalizedValue);
|
|
@@ -82720,7 +82600,7 @@ function normalizeConfigOptions(value, modes) {
|
|
|
82720
82600
|
const normalized = [];
|
|
82721
82601
|
if (Array.isArray(value)) {
|
|
82722
82602
|
for (const option of value) {
|
|
82723
|
-
if (!
|
|
82603
|
+
if (!isRecord5(option)) {
|
|
82724
82604
|
continue;
|
|
82725
82605
|
}
|
|
82726
82606
|
const id = truncate3(readString3(option["id"]), 128);
|
|
@@ -82760,12 +82640,12 @@ function normalizeConfigOptions(value, modes) {
|
|
|
82760
82640
|
}
|
|
82761
82641
|
}
|
|
82762
82642
|
}
|
|
82763
|
-
if (
|
|
82643
|
+
if (isRecord5(modes)) {
|
|
82764
82644
|
const values = [];
|
|
82765
82645
|
const availableModes = modes["availableModes"];
|
|
82766
82646
|
if (Array.isArray(availableModes)) {
|
|
82767
82647
|
for (const mode of availableModes) {
|
|
82768
|
-
if (!
|
|
82648
|
+
if (!isRecord5(mode)) {
|
|
82769
82649
|
continue;
|
|
82770
82650
|
}
|
|
82771
82651
|
const id = truncate3(readString3(mode["id"]), 500);
|
|
@@ -82798,7 +82678,7 @@ function normalizeConfigOptions(value, modes) {
|
|
|
82798
82678
|
return normalized.slice(0, MAXIMUM_CONFIG_OPTIONS);
|
|
82799
82679
|
}
|
|
82800
82680
|
function normalizeStandardLifecycle(response) {
|
|
82801
|
-
const lifecycle =
|
|
82681
|
+
const lifecycle = isRecord5(response) ? response : {};
|
|
82802
82682
|
return normalizeConfigOptions(lifecycle["configOptions"], lifecycle["modes"]);
|
|
82803
82683
|
}
|
|
82804
82684
|
function replaceStandardConfigOptions(current, value) {
|
|
@@ -82855,7 +82735,7 @@ var init_session_config_protocol = __esm({
|
|
|
82855
82735
|
"ACP agent exited while changing session configuration",
|
|
82856
82736
|
change.signal
|
|
82857
82737
|
);
|
|
82858
|
-
if (!
|
|
82738
|
+
if (!isRecord5(response) || !Array.isArray(response["configOptions"])) {
|
|
82859
82739
|
throw new SessionConfigProtocolError("The Agent returned an invalid session configuration response");
|
|
82860
82740
|
}
|
|
82861
82741
|
return replaceStandardConfigOptions(current, response["configOptions"]);
|
|
@@ -90694,7 +90574,7 @@ function decodeBase64(data) {
|
|
|
90694
90574
|
}
|
|
90695
90575
|
return bytes;
|
|
90696
90576
|
}
|
|
90697
|
-
function
|
|
90577
|
+
function isRecord6(value) {
|
|
90698
90578
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
90699
90579
|
}
|
|
90700
90580
|
var MAXIMUM_ENCODED_CONTENT_CHARACTERS, embeddedImageSchema, inlineImageUrlSchema, toolImageSchema, AcpContentExternalizer;
|
|
@@ -90831,13 +90711,13 @@ var init_content_externalizer = __esm({
|
|
|
90831
90711
|
}
|
|
90832
90712
|
return result2;
|
|
90833
90713
|
}
|
|
90834
|
-
if (!
|
|
90714
|
+
if (!isRecord6(value)) {
|
|
90835
90715
|
return value;
|
|
90836
90716
|
}
|
|
90837
90717
|
const image = toolImageSchema.safeParse(value);
|
|
90838
90718
|
if (image.success && image.data.data.length > 0) {
|
|
90839
90719
|
const prepared = await this.#content(sessionId, image.data, signal);
|
|
90840
|
-
if (
|
|
90720
|
+
if (isRecord6(prepared.event) && typeof prepared.event["imageKey"] === "string") {
|
|
90841
90721
|
images.set(prepared.event["imageKey"], prepared);
|
|
90842
90722
|
} else {
|
|
90843
90723
|
images.set(`unavailable:${images.size}`, prepared);
|
|
@@ -90868,7 +90748,7 @@ var init_content_externalizer = __esm({
|
|
|
90868
90748
|
const prepared = await this.#content(sessionId, content, signal);
|
|
90869
90749
|
agentContent.push({ ...item, content: prepared.agent });
|
|
90870
90750
|
eventContent.push({ ...item, content: prepared.event });
|
|
90871
|
-
if (
|
|
90751
|
+
if (isRecord6(prepared.event) && typeof prepared.event["imageKey"] === "string") {
|
|
90872
90752
|
images.delete(prepared.event["imageKey"]);
|
|
90873
90753
|
}
|
|
90874
90754
|
}
|
|
@@ -91029,7 +90909,7 @@ var init_relay_authentication = __esm({
|
|
|
91029
90909
|
|
|
91030
90910
|
// src/runtime/catalog/publish-agent-catalog.ts
|
|
91031
90911
|
import { fetch as fetch2 } from "undici";
|
|
91032
|
-
function
|
|
90912
|
+
function isRecord7(value) {
|
|
91033
90913
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
91034
90914
|
}
|
|
91035
90915
|
function isSafeRelayErrorMessage(value) {
|
|
@@ -91042,7 +90922,7 @@ async function rejectedCatalogError(response) {
|
|
|
91042
90922
|
} catch {
|
|
91043
90923
|
return new AgentCatalogPublishError("The Relay rejected the Agent catalog update");
|
|
91044
90924
|
}
|
|
91045
|
-
if (!
|
|
90925
|
+
if (!isRecord7(value) || !isRecord7(value["error"])) {
|
|
91046
90926
|
return new AgentCatalogPublishError("The Relay rejected the Agent catalog update");
|
|
91047
90927
|
}
|
|
91048
90928
|
const code = value["error"]["code"];
|
|
@@ -91391,7 +91271,7 @@ var init_runtime_connection = __esm({
|
|
|
91391
91271
|
// src/runtime/connection/runtime-installation-store.ts
|
|
91392
91272
|
import { randomUUID as randomUUID13 } from "node:crypto";
|
|
91393
91273
|
import { resolve as resolve15 } from "node:path";
|
|
91394
|
-
function
|
|
91274
|
+
function isRecord8(value) {
|
|
91395
91275
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
91396
91276
|
}
|
|
91397
91277
|
function hasExactKeys(value, expectedKeys) {
|
|
@@ -91458,7 +91338,7 @@ function installationId() {
|
|
|
91458
91338
|
return `min_${randomUUID13().replaceAll("-", "")}`;
|
|
91459
91339
|
}
|
|
91460
91340
|
function decodeInstallationPointer(value) {
|
|
91461
|
-
if (!
|
|
91341
|
+
if (!isRecord8(value) || !hasExactKeys(value, INSTALLATION_POINTER_KEYS) || value["version"] !== 1) {
|
|
91462
91342
|
throw new RuntimeInstallationStoreError("invalid_installation", "The local installation record is invalid");
|
|
91463
91343
|
}
|
|
91464
91344
|
const storedInstallationId = value["installationId"];
|
|
@@ -91468,7 +91348,7 @@ function decodeInstallationPointer(value) {
|
|
|
91468
91348
|
return { installationId: validateInstallationId(storedInstallationId) };
|
|
91469
91349
|
}
|
|
91470
91350
|
function decodeChannelIndex(value) {
|
|
91471
|
-
if (!
|
|
91351
|
+
if (!isRecord8(value) || !hasExactKeys(value, CHANNEL_INDEX_KEYS) || value["version"] !== 1) {
|
|
91472
91352
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
91473
91353
|
}
|
|
91474
91354
|
const applicationId = value["applicationId"];
|
|
@@ -91518,7 +91398,7 @@ function decodeVerifiedConnection(value) {
|
|
|
91518
91398
|
);
|
|
91519
91399
|
}
|
|
91520
91400
|
function decodeConnection(value) {
|
|
91521
|
-
if (!
|
|
91401
|
+
if (!isRecord8(value)) {
|
|
91522
91402
|
throw new RuntimeInstallationStoreError("invalid_connection", "The saved Runtime connection is invalid");
|
|
91523
91403
|
}
|
|
91524
91404
|
return decodeVerifiedConnection(value);
|
|
@@ -95048,22 +94928,19 @@ var init_session_interactions = __esm({
|
|
|
95048
94928
|
});
|
|
95049
94929
|
|
|
95050
94930
|
// src/session/live/session-configurations.ts
|
|
95051
|
-
var
|
|
94931
|
+
var storedSessionConfigurationSchema, decodeStoredSessionConfigurations, SessionConfigurations;
|
|
95052
94932
|
var init_session_configurations = __esm({
|
|
95053
94933
|
"src/session/live/session-configurations.ts"() {
|
|
95054
94934
|
"use strict";
|
|
95055
94935
|
init_zod();
|
|
95056
|
-
|
|
95057
|
-
external_exports.
|
|
95058
|
-
|
|
95059
|
-
|
|
95060
|
-
|
|
95061
|
-
|
|
95062
|
-
|
|
95063
|
-
|
|
95064
|
-
(configuration) => typeof configuration !== "object" || configuration === null || !("type" in configuration) || typeof configuration.type !== "string" || configuration.type === "boolean" || configuration.type === "select"
|
|
95065
|
-
) : value
|
|
95066
|
-
);
|
|
94936
|
+
storedSessionConfigurationSchema = external_exports.discriminatedUnion("type", [
|
|
94937
|
+
external_exports.object({ booleanValue: external_exports.boolean(), configId: external_exports.string().max(128), type: external_exports.literal("boolean") }),
|
|
94938
|
+
external_exports.object({ configId: external_exports.string().max(128), type: external_exports.literal("select"), value: external_exports.string().max(500) })
|
|
94939
|
+
]);
|
|
94940
|
+
decodeStoredSessionConfigurations = (value) => external_exports.array(external_exports.unknown()).max(100).parse(value).flatMap((configuration) => {
|
|
94941
|
+
const decoded = storedSessionConfigurationSchema.safeParse(configuration);
|
|
94942
|
+
return decoded.success ? [decoded.data] : [];
|
|
94943
|
+
});
|
|
95067
94944
|
SessionConfigurations = class {
|
|
95068
94945
|
#selected = [];
|
|
95069
94946
|
stored = () => this.#selected;
|