@super-one/cli 0.73.0-alpha.2 → 0.73.0-alpha.4
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/MANIFEST.json +2 -2
- package/lib/cli.mjs +773 -474
- package/package.json +1 -1
package/lib/cli.mjs
CHANGED
|
@@ -137,8 +137,8 @@ import { fileURLToPath } from "node:url";
|
|
|
137
137
|
function resolveCliReleaseVersion() {
|
|
138
138
|
const fromEnv = process.env.SUPERONE_CLI_VERSION?.trim();
|
|
139
139
|
if (fromEnv) return fromEnv;
|
|
140
|
-
if ("0.73.0-alpha.
|
|
141
|
-
return "0.73.0-alpha.
|
|
140
|
+
if ("0.73.0-alpha.4".trim()) {
|
|
141
|
+
return "0.73.0-alpha.4".trim();
|
|
142
142
|
}
|
|
143
143
|
const fromDist = readDistManifestVersion();
|
|
144
144
|
if (fromDist) return fromDist;
|
|
@@ -409,7 +409,7 @@ var init_interaction_memory = __esm({
|
|
|
409
409
|
});
|
|
410
410
|
|
|
411
411
|
// ../../packages/shared/src/superone-tool-descriptions.ts
|
|
412
|
-
var MANUAL_READ_DESCRIPTION, SETUP_MINI_APP_DEV_DESCRIPTION, REGISTER_DEV_MINIAPP_DESCRIPTION, PACK_MINI_APP_DESCRIPTION, UPDATE_SUPERONE_TYPES_DESCRIPTION, MINIAPP_DEV_PREVIEW_DESCRIPTION, MINIAPP_DEV_RELOAD_DESCRIPTION, MINIAPP_DEV_PREVIEW_INPUT_SCHEMA, MINIAPP_DEV_RELOAD_INPUT_SCHEMA, RENAME_SESSION_DESCRIPTION, SESSION_TAG_DESCRIPTION, SESSION_TAG_LIST_DESCRIPTION, PROJECT_LIST_DESCRIPTION, SESSION_LIST_DESCRIPTION, SESSION_SEARCH_DESCRIPTION, SESSION_READ_DESCRIPTION, SESSION_READ_MESSAGE_ID_DESCRIPTION, SESSION_READ_AROUND_DESCRIPTION, SESSION_READ_CURSOR_DESCRIPTION, SESSION_READ_LIMIT_DESCRIPTION, SESSION_READ_THINKING_DESCRIPTION, SESSION_TAGS_FILTER_DESCRIPTION, SESSION_TAG_MATCH_DESCRIPTION, SESSION_CLEANUP_DESCRIPTION, CONFIG_READ_DESCRIPTION, CONFIG_APPLY_DESCRIPTION, LIST_MEDIA_PROVIDERS_DESCRIPTION, GENERATE_IMAGE_DESCRIPTION, GENERATE_VIDEO_DESCRIPTION, VIDEO_STATUS_DESCRIPTION, SESSION_LIST_AGENTS_DESCRIPTION, SESSION_REQUEST_AGENTS_DESCRIPTION, LAUNCH_SUMMARY_DESCRIPTION, START_LAUNCH_ID_DESCRIPTION, LAUNCH_TASK_DESCRIPTION, LAUNCH_MODE_DESCRIPTION, LAUNCH_SESSION_ID_DESCRIPTION, LAUNCH_PERMISSION_MODE_DESCRIPTION, LAUNCH_ENVIRONMENT_DESCRIPTION, LAUNCH_CWD_DESCRIPTION, LAUNCH_WORKTREE_DESCRIPTION, LAUNCH_BRANCH_NAME_DESCRIPTION, SESSION_START_DESCRIPTION, SESSION_SEND_DESCRIPTION, SESSION_SEND_TO_DESCRIPTION, SESSION_SEND_CONTENT_DESCRIPTION, SESSION_RETRIEVE_DESCRIPTION, SESSION_RETRIEVE_FROM_DESCRIPTION, AUTOMATION_LIST_DESCRIPTION, AUTOMATION_APPLY_DESCRIPTION, AUTOMATION_DELETE_DESCRIPTION, TERMINAL_TABS_DESCRIPTION, TERMINAL_SNAPSHOT_DESCRIPTION, TERMINAL_ACT_DESCRIPTION, TERMINAL_WAIT_FOR_DESCRIPTION, ENVIRONMENT_GET_INFO_DESCRIPTION, ENVIRONMENT_GET_INFO_IDS_DESCRIPTION, ENVIRONMENT_GET_INFO_INCLUDE_DESCRIPTION, ARCHIVE_ENVIRONMENT_DESCRIPTION;
|
|
412
|
+
var MANUAL_READ_DESCRIPTION, SETUP_MINI_APP_DEV_DESCRIPTION, REGISTER_DEV_MINIAPP_DESCRIPTION, PACK_MINI_APP_DESCRIPTION, UPDATE_SUPERONE_TYPES_DESCRIPTION, MINIAPP_DEV_PREVIEW_DESCRIPTION, MINIAPP_DEV_RELOAD_DESCRIPTION, MINIAPP_DEV_PREVIEW_INPUT_SCHEMA, MINIAPP_DEV_RELOAD_INPUT_SCHEMA, RENAME_SESSION_DESCRIPTION, SESSION_TAG_DESCRIPTION, SESSION_TAG_LIST_DESCRIPTION, PROJECT_LIST_DESCRIPTION, SESSION_LIST_DESCRIPTION, SESSION_SEARCH_DESCRIPTION, SESSION_READ_DESCRIPTION, SESSION_READ_MESSAGE_ID_DESCRIPTION, SESSION_READ_AROUND_DESCRIPTION, SESSION_READ_CURSOR_DESCRIPTION, SESSION_READ_LIMIT_DESCRIPTION, SESSION_READ_THINKING_DESCRIPTION, SESSION_TAGS_FILTER_DESCRIPTION, SESSION_TAG_MATCH_DESCRIPTION, SESSION_CLEANUP_DESCRIPTION, CONFIG_READ_DESCRIPTION, CONFIG_APPLY_DESCRIPTION, LIST_MEDIA_PROVIDERS_DESCRIPTION, GENERATE_IMAGE_DESCRIPTION, GENERATE_VIDEO_DESCRIPTION, VIDEO_STATUS_DESCRIPTION, SESSION_LIST_AGENTS_DESCRIPTION, SESSION_REQUEST_AGENTS_DESCRIPTION, LAUNCH_SUMMARY_DESCRIPTION, START_LAUNCH_ID_DESCRIPTION, LAUNCH_TASK_DESCRIPTION, LAUNCH_MODE_DESCRIPTION, LAUNCH_SESSION_ID_DESCRIPTION, LAUNCH_PERMISSION_MODE_DESCRIPTION, LAUNCH_ENVIRONMENT_DESCRIPTION, LAUNCH_CWD_DESCRIPTION, LAUNCH_WORKTREE_DESCRIPTION, LAUNCH_BRANCH_NAME_DESCRIPTION, SESSION_START_DESCRIPTION, SESSION_SEND_DESCRIPTION, SESSION_SEND_TO_DESCRIPTION, SESSION_SEND_CONTENT_DESCRIPTION, SESSION_RETRIEVE_DESCRIPTION, SESSION_RETRIEVE_FROM_DESCRIPTION, SESSION_SUGGEST_TASK_DESCRIPTION, SUGGEST_TASK_TITLE_DESCRIPTION, SUGGEST_TASK_TLDR_DESCRIPTION, SUGGEST_TASK_PROMPT_DESCRIPTION, SUGGEST_TASK_CWD_DESCRIPTION, AUTOMATION_LIST_DESCRIPTION, AUTOMATION_APPLY_DESCRIPTION, AUTOMATION_DELETE_DESCRIPTION, TERMINAL_TABS_DESCRIPTION, TERMINAL_SNAPSHOT_DESCRIPTION, TERMINAL_ACT_DESCRIPTION, TERMINAL_WAIT_FOR_DESCRIPTION, ENVIRONMENT_GET_INFO_DESCRIPTION, ENVIRONMENT_GET_INFO_IDS_DESCRIPTION, ENVIRONMENT_GET_INFO_INCLUDE_DESCRIPTION, ARCHIVE_ENVIRONMENT_DESCRIPTION;
|
|
413
413
|
var init_superone_tool_descriptions = __esm({
|
|
414
414
|
"../../packages/shared/src/superone-tool-descriptions.ts"() {
|
|
415
415
|
"use strict";
|
|
@@ -481,6 +481,11 @@ var init_superone_tool_descriptions = __esm({
|
|
|
481
481
|
SESSION_SEND_CONTENT_DESCRIPTION = "Mailbox message body in Markdown. Prefer structured Markdown (headings, lists, code fences) for agent-to-agent handoffs; the SuperOne UI renders it as a Markdown preview.";
|
|
482
482
|
SESSION_RETRIEVE_DESCRIPTION = 'Read queued Markdown messages from your collaboration peers and list those peers (session id, name, relation). Child peers may also report state (running, awaiting_approval, stalled, idle, error), lastActivityAt, and runningTool. Call after a collaboration wake, before acting on peer input, or to find out who you can message. This is a non-blocking read: status "empty" is not a retry signal. Do not sleep or poll; end your turn and wait for the next wake.';
|
|
483
483
|
SESSION_RETRIEVE_FROM_DESCRIPTION = "Only read messages from these peer session ids. Omit to read from every peer.";
|
|
484
|
+
SESSION_SUGGEST_TASK_DESCRIPTION = "Suggest a side task the user can launch later as its own session. Use when you notice a real issue outside the current task (a bug, cleanup, or follow-up) that should not derail it. Returns a taskId at once, without an approval prompt; keep working. The user sees a card and may launch it as a new top-level session or dismiss it; if it goes stale, say so in your reply. To hand work over now, use session_collab_request instead.";
|
|
485
|
+
SUGGEST_TASK_TITLE_DESCRIPTION = "Card title, starting with a verb.";
|
|
486
|
+
SUGGEST_TASK_TLDR_DESCRIPTION = "One or two sentences shown on the card.";
|
|
487
|
+
SUGGEST_TASK_PROMPT_DESCRIPTION = "Markdown brief delivered as the new session's opening turn. The receiver cannot ask you anything, so include the context, file paths, and what done looks like.";
|
|
488
|
+
SUGGEST_TASK_CWD_DESCRIPTION = "Absolute root of a genuinely different project; omit for the current project.";
|
|
484
489
|
AUTOMATION_LIST_DESCRIPTION = "List project automations with schedule and last/next run. Pass id for full prompt, agentConfig, and schedule; filter by query or enabled. Find unknown ids here before automation_apply or automation_delete; check for duplicates before creation when needed.";
|
|
485
490
|
AUTOMATION_APPLY_DESCRIPTION = 'Create or update a project automation. create needs name, prompt, schedule; update needs id plus any field (pause via enabled=false). Call automation_list first for ids; remove with automation_delete. Always opens a user confirmation dialog and applies nothing without approval. For schedule and agentConfig shapes see read_manual({ domain: "product", topic: "automation" }).';
|
|
486
491
|
AUTOMATION_DELETE_DESCRIPTION = "Permanently delete project automations by id (from automation_list). Always opens a user confirmation dialog. Current project only. Prefer automation_list to choose ids first.";
|
|
@@ -496,11 +501,22 @@ var init_superone_tool_descriptions = __esm({
|
|
|
496
501
|
});
|
|
497
502
|
|
|
498
503
|
// ../../packages/shared/src/environment/host-action-collaboration-descriptors.ts
|
|
499
|
-
var HOST_ACTION_COLLABORATION_DESCRIPTORS;
|
|
504
|
+
var SESSION_SUGGEST_TASK_INPUT_SCHEMA, HOST_ACTION_COLLABORATION_DESCRIPTORS;
|
|
500
505
|
var init_host_action_collaboration_descriptors = __esm({
|
|
501
506
|
"../../packages/shared/src/environment/host-action-collaboration-descriptors.ts"() {
|
|
502
507
|
"use strict";
|
|
503
508
|
init_superone_tool_descriptions();
|
|
509
|
+
SESSION_SUGGEST_TASK_INPUT_SCHEMA = {
|
|
510
|
+
type: "object",
|
|
511
|
+
properties: {
|
|
512
|
+
title: { type: "string", minLength: 1, maxLength: 60, description: SUGGEST_TASK_TITLE_DESCRIPTION },
|
|
513
|
+
tldr: { type: "string", minLength: 1, description: SUGGEST_TASK_TLDR_DESCRIPTION },
|
|
514
|
+
prompt: { type: "string", minLength: 1, description: SUGGEST_TASK_PROMPT_DESCRIPTION },
|
|
515
|
+
cwd: { type: "string", description: SUGGEST_TASK_CWD_DESCRIPTION }
|
|
516
|
+
},
|
|
517
|
+
required: ["title", "tldr", "prompt"],
|
|
518
|
+
additionalProperties: false
|
|
519
|
+
};
|
|
504
520
|
HOST_ACTION_COLLABORATION_DESCRIPTORS = [
|
|
505
521
|
{
|
|
506
522
|
"name": "session_collab_list_agents",
|
|
@@ -730,6 +746,11 @@ var init_host_action_collaboration_descriptors = __esm({
|
|
|
730
746
|
},
|
|
731
747
|
"additionalProperties": false
|
|
732
748
|
}
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
"name": "session_suggest_task",
|
|
752
|
+
"description": SESSION_SUGGEST_TASK_DESCRIPTION,
|
|
753
|
+
"inputSchema": SESSION_SUGGEST_TASK_INPUT_SCHEMA
|
|
733
754
|
}
|
|
734
755
|
];
|
|
735
756
|
}
|
|
@@ -4557,7 +4578,8 @@ var init_host_action_browser_catalog = __esm({
|
|
|
4557
4578
|
"session_collab_request",
|
|
4558
4579
|
"session_collab_start",
|
|
4559
4580
|
"session_collab_send",
|
|
4560
|
-
"session_collab_retrieve"
|
|
4581
|
+
"session_collab_retrieve",
|
|
4582
|
+
"session_suggest_task"
|
|
4561
4583
|
];
|
|
4562
4584
|
SUPERONE_READ_NAMES = /* @__PURE__ */ new Set([
|
|
4563
4585
|
"read_manual",
|
|
@@ -4827,13 +4849,13 @@ var init_events = __esm({
|
|
|
4827
4849
|
|
|
4828
4850
|
// ../../packages/shared/src/environment/session-events.ts
|
|
4829
4851
|
function streamingEventKey(eventType, payload) {
|
|
4830
|
-
const
|
|
4852
|
+
const record12 = payload ?? {};
|
|
4831
4853
|
if (eventType === SESSION_DURABLE_EVENT.assistantDelta) {
|
|
4832
|
-
return { messageId: typeof
|
|
4854
|
+
return { messageId: typeof record12.blockId === "string" ? record12.blockId : null };
|
|
4833
4855
|
}
|
|
4834
4856
|
if (eventType === SESSION_DURABLE_EVENT.toolInputDelta) return { messageId: null };
|
|
4835
4857
|
if (eventType !== SESSION_DURABLE_EVENT.agentEvent) return null;
|
|
4836
|
-
const event =
|
|
4858
|
+
const event = record12.event;
|
|
4837
4859
|
switch (event?.type) {
|
|
4838
4860
|
case "content_delta":
|
|
4839
4861
|
return event.delta.type === "text" || event.delta.type === "thinking" ? { messageId: event.messageId } : null;
|
|
@@ -4847,10 +4869,10 @@ function streamingEventKey(eventType, payload) {
|
|
|
4847
4869
|
}
|
|
4848
4870
|
}
|
|
4849
4871
|
function committedStreamingMessage(eventType, payload) {
|
|
4850
|
-
const
|
|
4872
|
+
const record12 = payload ?? {};
|
|
4851
4873
|
switch (eventType) {
|
|
4852
4874
|
case SESSION_DURABLE_EVENT.assistantMessage:
|
|
4853
|
-
return typeof
|
|
4875
|
+
return typeof record12.blockId === "string" ? record12.blockId : null;
|
|
4854
4876
|
case SESSION_DURABLE_EVENT.turnCompleted:
|
|
4855
4877
|
case SESSION_DURABLE_EVENT.turnInterrupted:
|
|
4856
4878
|
case SESSION_DURABLE_EVENT.turnError:
|
|
@@ -4858,7 +4880,7 @@ function committedStreamingMessage(eventType, payload) {
|
|
|
4858
4880
|
case SESSION_DURABLE_EVENT.removed:
|
|
4859
4881
|
return null;
|
|
4860
4882
|
case SESSION_DURABLE_EVENT.agentEvent: {
|
|
4861
|
-
const event =
|
|
4883
|
+
const event = record12.event;
|
|
4862
4884
|
if (event?.type === "message_complete" || event?.type === "message_interrupted" || event?.type === "message_error") return event.messageId;
|
|
4863
4885
|
if (event?.type === "status_change" && event.status !== "streaming") return null;
|
|
4864
4886
|
return void 0;
|
|
@@ -9414,6 +9436,7 @@ var init_superone_host_owned_tools = __esm({
|
|
|
9414
9436
|
"session_collab_start",
|
|
9415
9437
|
"session_collab_send",
|
|
9416
9438
|
"session_collab_retrieve",
|
|
9439
|
+
"session_suggest_task",
|
|
9417
9440
|
"media_list_providers",
|
|
9418
9441
|
"media_generate_image",
|
|
9419
9442
|
"media_generate_video",
|
|
@@ -9963,6 +9986,7 @@ function sessionMessageRange(messages, page2 = {}) {
|
|
|
9963
9986
|
if (page2.direction !== void 0 && !["around", "before", "after"].includes(page2.direction)) throw invalid("direction must be around|before|after");
|
|
9964
9987
|
if (page2.direction !== void 0 && !page2.anchorId) throw invalid("direction requires anchorId");
|
|
9965
9988
|
if (page2.anchorId !== void 0 && (!page2.anchorId.trim() || page2.before != null)) throw invalid("anchorId must be non-empty and cannot be combined with before");
|
|
9989
|
+
if (page2.full) return { start: 0, end: messages.length };
|
|
9966
9990
|
const size = Math.min(page2.limit ?? 50, 200);
|
|
9967
9991
|
if (page2.anchorId !== void 0) {
|
|
9968
9992
|
const anchor = messages.findIndex((message) => message.id === page2.anchorId);
|
|
@@ -10467,6 +10491,10 @@ function parseMessageDisplay(value) {
|
|
|
10467
10491
|
};
|
|
10468
10492
|
});
|
|
10469
10493
|
}
|
|
10494
|
+
if (input.userSelections !== void 0) {
|
|
10495
|
+
if (!Array.isArray(input.userSelections) || input.userSelections.some((value2) => typeof value2 !== "string")) throw new Error("Invalid quoted selections");
|
|
10496
|
+
if (input.userSelections.length) result2.userSelections = input.userSelections;
|
|
10497
|
+
}
|
|
10470
10498
|
if (input.collaboration !== void 0) {
|
|
10471
10499
|
const collaboration = input.collaboration;
|
|
10472
10500
|
if (collaboration?.kind !== "initial_task") throw new Error("Invalid collaboration delivery");
|
|
@@ -10665,16 +10693,22 @@ function mergeMcpAppBlocks(previous, next) {
|
|
|
10665
10693
|
return next.map((block) => {
|
|
10666
10694
|
const value = record4(block);
|
|
10667
10695
|
const previousRow = typeof value.id === "string" ? rows.get(value.id) ?? {} : {};
|
|
10668
|
-
|
|
10669
|
-
|
|
10670
|
-
|
|
10671
|
-
if (childItems) return { ...block, childItems };
|
|
10672
|
-
}
|
|
10673
|
-
const app = value.app;
|
|
10674
|
-
if (app) return { ...block, app: mergeMcpAppAttachment(apps.get(app.appInstanceId), app) };
|
|
10675
|
-
return previousRow.type === value.type && previousRow.app ? { ...block, app: previousRow.app } : block;
|
|
10696
|
+
const merged = mergeAppRow(block, previousRow, apps);
|
|
10697
|
+
const suggestedTask = previousRow.type === value.type ? previousRow.suggestedTask : void 0;
|
|
10698
|
+
return suggestedTask && !record4(merged).suggestedTask ? { ...merged, suggestedTask } : merged;
|
|
10676
10699
|
});
|
|
10677
10700
|
}
|
|
10701
|
+
function mergeAppRow(block, previousRow, apps) {
|
|
10702
|
+
const value = record4(block);
|
|
10703
|
+
if (value.type === "collab_tool_call" && previousRow.type === value.type) {
|
|
10704
|
+
const previousChildren = record4(previousRow.childItems);
|
|
10705
|
+
const childItems = value.childItems === void 0 ? previousRow.childItems : Object.fromEntries(Object.entries(record4(value.childItems)).map(([threadId, children]) => [threadId, Array.isArray(children) ? mergeMcpAppBlocks(Array.isArray(previousChildren[threadId]) ? previousChildren[threadId] : [], children) : children]));
|
|
10706
|
+
if (childItems) return { ...block, childItems };
|
|
10707
|
+
}
|
|
10708
|
+
const app = value.app;
|
|
10709
|
+
if (app) return { ...block, app: mergeMcpAppAttachment(apps.get(app.appInstanceId), app) };
|
|
10710
|
+
return previousRow.type === value.type && previousRow.app ? { ...block, app: previousRow.app } : block;
|
|
10711
|
+
}
|
|
10678
10712
|
function validateMcpAppAttachmentUpdate(update) {
|
|
10679
10713
|
if (update.resource) validateMcpAppResource(update.resource);
|
|
10680
10714
|
assertMcpAppSize({ modelContext: update.modelContext });
|
|
@@ -12147,7 +12181,7 @@ var init_message_completed_at = __esm({
|
|
|
12147
12181
|
});
|
|
12148
12182
|
|
|
12149
12183
|
// ../../packages/shared/src/node-session-event-map.ts
|
|
12150
|
-
function
|
|
12184
|
+
function asRecord2(value) {
|
|
12151
12185
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
12152
12186
|
return value;
|
|
12153
12187
|
}
|
|
@@ -12179,7 +12213,7 @@ function stamp(event, ctx, envelope) {
|
|
|
12179
12213
|
}
|
|
12180
12214
|
function mapQuestionRequest(payload, fallbackId) {
|
|
12181
12215
|
const interactionId = asString2(payload.interactionId) ?? asString2(payload.requestId) ?? fallbackId;
|
|
12182
|
-
const input =
|
|
12216
|
+
const input = asRecord2(payload.input);
|
|
12183
12217
|
const rawQuestions = Array.isArray(payload.questions) ? payload.questions : Array.isArray(input.questions) ? input.questions : [];
|
|
12184
12218
|
const questions = [];
|
|
12185
12219
|
for (const q2 of rawQuestions) {
|
|
@@ -12218,7 +12252,7 @@ function mapQuestionRequest(payload, fallbackId) {
|
|
|
12218
12252
|
}
|
|
12219
12253
|
function mapPlanRequest(payload, fallbackId) {
|
|
12220
12254
|
const interactionId = asString2(payload.interactionId) ?? asString2(payload.requestId) ?? fallbackId;
|
|
12221
|
-
const input =
|
|
12255
|
+
const input = asRecord2(payload.input);
|
|
12222
12256
|
let planContent = asString2(payload.plan) ?? asString2(payload.planContent) ?? asString2(input.plan) ?? asString2(input.planContent) ?? "";
|
|
12223
12257
|
if (!planContent && input.plan && typeof input.plan === "object") {
|
|
12224
12258
|
try {
|
|
@@ -12299,7 +12333,7 @@ function createNodeSessionEventMapper(ctx) {
|
|
|
12299
12333
|
if (envelope.aggregateType && envelope.aggregateType !== "session") return [];
|
|
12300
12334
|
if (envelope.aggregateId && envelope.aggregateId !== ctx.sessionId) return [];
|
|
12301
12335
|
const eventType = envelope.eventType;
|
|
12302
|
-
const payload =
|
|
12336
|
+
const payload = asRecord2(envelope.payload);
|
|
12303
12337
|
const out = [];
|
|
12304
12338
|
const push = (event, positioned = true) => {
|
|
12305
12339
|
out.push(stamp(stampCompletedAt(event, new Date(envelope.timestamp).toISOString()), ctx, positioned ? envelope : void 0));
|
|
@@ -12325,7 +12359,7 @@ function createNodeSessionEventMapper(ctx) {
|
|
|
12325
12359
|
break;
|
|
12326
12360
|
}
|
|
12327
12361
|
case SESSION_DURABLE_EVENT.agentEvent: {
|
|
12328
|
-
const rawEvent =
|
|
12362
|
+
const rawEvent = asRecord2(payload.event);
|
|
12329
12363
|
const type = asString2(rawEvent.type);
|
|
12330
12364
|
if (!type) break;
|
|
12331
12365
|
const eventRecord = { ...rawEvent };
|
|
@@ -12339,7 +12373,7 @@ function createNodeSessionEventMapper(ctx) {
|
|
|
12339
12373
|
push(event);
|
|
12340
12374
|
break;
|
|
12341
12375
|
}
|
|
12342
|
-
const rawMessageId = type === "message_start" ? asString2(
|
|
12376
|
+
const rawMessageId = type === "message_start" ? asString2(asRecord2(eventRecord.message).id) : asString2(eventRecord.messageId);
|
|
12343
12377
|
if (type === "message_start" && rawMessageId) {
|
|
12344
12378
|
startedAssistantIds.add(rawMessageId);
|
|
12345
12379
|
lastAssistantId = rawMessageId;
|
|
@@ -12519,7 +12553,7 @@ function createNodeSessionEventMapper(ctx) {
|
|
|
12519
12553
|
requestId: interactionId,
|
|
12520
12554
|
toolName,
|
|
12521
12555
|
toolUseId: asString2(payload.toolUseId),
|
|
12522
|
-
input:
|
|
12556
|
+
input: asRecord2(payload.input),
|
|
12523
12557
|
allowAlwaysAllow: requestKind === "session_agents_confirm" ? false : payload.allowAlwaysAllow !== false,
|
|
12524
12558
|
...requestKind ? {
|
|
12525
12559
|
requestKind
|
|
@@ -12679,7 +12713,7 @@ var init_mcp_apps_catalog = __esm({
|
|
|
12679
12713
|
});
|
|
12680
12714
|
|
|
12681
12715
|
// ../../packages/runtime/src/session/message-catalog.ts
|
|
12682
|
-
function
|
|
12716
|
+
function asRecord3(value) {
|
|
12683
12717
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
12684
12718
|
return value;
|
|
12685
12719
|
}
|
|
@@ -12762,7 +12796,7 @@ function collectToolsByAssistantId(events, sessionId) {
|
|
|
12762
12796
|
for (const ev of events) {
|
|
12763
12797
|
if (ev.aggregateType && ev.aggregateType !== "session") continue;
|
|
12764
12798
|
if (ev.aggregateId && ev.aggregateId !== sessionId) continue;
|
|
12765
|
-
const payload =
|
|
12799
|
+
const payload = asRecord3(ev.payload);
|
|
12766
12800
|
switch (ev.eventType) {
|
|
12767
12801
|
case SESSION_DURABLE_EVENT.turnStarted: {
|
|
12768
12802
|
turnKey += 1;
|
|
@@ -12788,10 +12822,10 @@ function collectToolsByAssistantId(events, sessionId) {
|
|
|
12788
12822
|
break;
|
|
12789
12823
|
}
|
|
12790
12824
|
case SESSION_DURABLE_EVENT.agentEvent: {
|
|
12791
|
-
const raw =
|
|
12825
|
+
const raw = asRecord3(payload.event);
|
|
12792
12826
|
const type = asString3(raw.type);
|
|
12793
12827
|
if (type === "message_start") {
|
|
12794
|
-
const id = asString3(
|
|
12828
|
+
const id = asString3(asRecord3(raw.message).id);
|
|
12795
12829
|
if (id) bindAssistant(id);
|
|
12796
12830
|
} else if (type === "message_complete") {
|
|
12797
12831
|
const id = asString3(raw.messageId);
|
|
@@ -12799,7 +12833,7 @@ function collectToolsByAssistantId(events, sessionId) {
|
|
|
12799
12833
|
} else if (type === "content_delta") {
|
|
12800
12834
|
const messageId = asString3(raw.messageId);
|
|
12801
12835
|
if (messageId) bindAssistant(messageId);
|
|
12802
|
-
const delta =
|
|
12836
|
+
const delta = asRecord3(raw.delta);
|
|
12803
12837
|
const dType = asString3(delta.type);
|
|
12804
12838
|
if (dType === "tool_use") {
|
|
12805
12839
|
const toolUseId = asString3(delta.toolUseId);
|
|
@@ -12942,7 +12976,7 @@ function collectContentByAssistantId(events, sessionId) {
|
|
|
12942
12976
|
if (changed) contentById.set(ev.messageId, next);
|
|
12943
12977
|
}
|
|
12944
12978
|
}
|
|
12945
|
-
const payload =
|
|
12979
|
+
const payload = asRecord3(envelope.payload);
|
|
12946
12980
|
if (envelope.eventType === SESSION_DURABLE_EVENT.assistantMessage) {
|
|
12947
12981
|
const blockId = asString3(payload.blockId);
|
|
12948
12982
|
const sticky = stickyBefore ?? mapper.currentAssistantMessageId();
|
|
@@ -12966,7 +13000,7 @@ function extractCheckpointMeta(events, sessionId, blockId) {
|
|
|
12966
13000
|
const ev = events[i];
|
|
12967
13001
|
if (ev.aggregateType && ev.aggregateType !== "session") continue;
|
|
12968
13002
|
if (ev.aggregateId && ev.aggregateId !== sessionId) continue;
|
|
12969
|
-
const payload =
|
|
13003
|
+
const payload = asRecord3(ev.payload);
|
|
12970
13004
|
if (ev.eventType === SESSION_DURABLE_EVENT.assistantMessage) {
|
|
12971
13005
|
if (asString3(payload.blockId) !== blockId) continue;
|
|
12972
13006
|
const checkpointId = asString3(payload.checkpointId);
|
|
@@ -12981,7 +13015,7 @@ function extractCheckpointMeta(events, sessionId, blockId) {
|
|
|
12981
13015
|
}
|
|
12982
13016
|
}
|
|
12983
13017
|
if (ev.eventType === SESSION_DURABLE_EVENT.agentEvent) {
|
|
12984
|
-
const raw =
|
|
13018
|
+
const raw = asRecord3(payload.event);
|
|
12985
13019
|
if (asString3(raw.type) !== "message_complete" && asString3(raw.type) !== "checkpoint_captured") {
|
|
12986
13020
|
continue;
|
|
12987
13021
|
}
|
|
@@ -14990,7 +15024,7 @@ var init_session_runtime = __esm({
|
|
|
14990
15024
|
return this.clone(session);
|
|
14991
15025
|
}
|
|
14992
15026
|
validateSettings(patch) {
|
|
14993
|
-
if (patch.mode !== void 0 || patch.agentPreset !== void 0 || patch.additionalDirectories !== void 0) {
|
|
15027
|
+
if (patch.mode !== void 0 || patch.agentPreset !== void 0 || patch.additionalDirectories !== void 0 || patch.ultracode !== void 0 || patch.contextWindow !== void 0 || patch.serviceTier !== void 0 || patch.permissionPreset !== void 0 || patch.collaborationMode !== void 0 || patch.agent !== void 0) {
|
|
14994
15028
|
throw Object.assign(new Error("This node does not support desktop harness settings"), { code: "unsupported" });
|
|
14995
15029
|
}
|
|
14996
15030
|
}
|
|
@@ -16824,6 +16858,80 @@ var init_codex_metadata2 = __esm({
|
|
|
16824
16858
|
}
|
|
16825
16859
|
});
|
|
16826
16860
|
|
|
16861
|
+
// ../../packages/shared/src/suggested-task.ts
|
|
16862
|
+
function record5(value) {
|
|
16863
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
16864
|
+
}
|
|
16865
|
+
function isSuggestTool(toolName) {
|
|
16866
|
+
if (typeof toolName !== "string") return false;
|
|
16867
|
+
const mcp = parseMcpToolName(toolName);
|
|
16868
|
+
return mcp?.serverName === "superone" && mcp.mcpToolName === SUGGEST_TASK_TOOL_NAME;
|
|
16869
|
+
}
|
|
16870
|
+
function codexItemResultText(item) {
|
|
16871
|
+
const content = record5(item.result).content;
|
|
16872
|
+
if (!Array.isArray(content)) return "";
|
|
16873
|
+
return content.map((part) => record5(part).text).filter((text2) => typeof text2 === "string").join("\n");
|
|
16874
|
+
}
|
|
16875
|
+
function contentOf(message) {
|
|
16876
|
+
const content = record5(message).content;
|
|
16877
|
+
return Array.isArray(content) ? content.map(record5) : [];
|
|
16878
|
+
}
|
|
16879
|
+
function locateToolUse(messages, toolUseId) {
|
|
16880
|
+
for (let messageIndex = messages.length - 1; messageIndex >= 0; messageIndex--) {
|
|
16881
|
+
const use = contentOf(messages[messageIndex]).find((row2) => row2.type === "tool_use" && row2.toolUseId === toolUseId);
|
|
16882
|
+
if (use) return isSuggestTool(use.toolName) ? { messageIndex, rowId: String(use.toolUseId), kind: "block", row: use } : null;
|
|
16883
|
+
}
|
|
16884
|
+
return null;
|
|
16885
|
+
}
|
|
16886
|
+
function locate(messages, taskId) {
|
|
16887
|
+
if (!taskId) return null;
|
|
16888
|
+
for (let messageIndex = messages.length - 1; messageIndex >= 0; messageIndex--) {
|
|
16889
|
+
const message = record5(messages[messageIndex]);
|
|
16890
|
+
for (const block of contentOf(message)) {
|
|
16891
|
+
if (block.type !== "tool_result" || typeof block.summary !== "string" || !block.summary.includes(taskId)) continue;
|
|
16892
|
+
const use = locateToolUse(messages, block.toolUseId);
|
|
16893
|
+
if (use) return use;
|
|
16894
|
+
}
|
|
16895
|
+
const items = record5(record5(message.metadata).codex).items;
|
|
16896
|
+
if (!Array.isArray(items)) continue;
|
|
16897
|
+
for (const item of items.map(record5)) {
|
|
16898
|
+
if (item.type !== "mcp_tool_call" || !isSuggestTool(`mcp__${String(item.server)}__${String(item.tool)}`)) continue;
|
|
16899
|
+
if (codexItemResultText(item).includes(taskId)) {
|
|
16900
|
+
return { messageIndex, rowId: String(item.id), kind: "codex", row: item };
|
|
16901
|
+
}
|
|
16902
|
+
}
|
|
16903
|
+
}
|
|
16904
|
+
return null;
|
|
16905
|
+
}
|
|
16906
|
+
function applySuggestedTaskUpdate(messages, taskId, state) {
|
|
16907
|
+
const found = locate(messages, taskId);
|
|
16908
|
+
if (!found || found.row.suggestedTask) return messages;
|
|
16909
|
+
const patch = (row2) => {
|
|
16910
|
+
const value = record5(row2);
|
|
16911
|
+
const id = found.kind === "block" ? value.toolUseId : value.id;
|
|
16912
|
+
const matches = found.kind === "block" ? value.type === "tool_use" : value.type === "mcp_tool_call";
|
|
16913
|
+
return matches && id === found.rowId ? { ...value, suggestedTask: state } : row2;
|
|
16914
|
+
};
|
|
16915
|
+
return messages.map((message, index) => {
|
|
16916
|
+
if (index !== found.messageIndex) return message;
|
|
16917
|
+
const value = record5(message);
|
|
16918
|
+
if (found.kind === "block") {
|
|
16919
|
+
return { ...value, content: value.content.map(patch) };
|
|
16920
|
+
}
|
|
16921
|
+
const metadata = record5(value.metadata);
|
|
16922
|
+
const codex = record5(metadata.codex);
|
|
16923
|
+
return { ...value, metadata: { ...metadata, codex: { ...codex, items: codex.items.map(patch) } } };
|
|
16924
|
+
});
|
|
16925
|
+
}
|
|
16926
|
+
var SUGGEST_TASK_TOOL_NAME;
|
|
16927
|
+
var init_suggested_task = __esm({
|
|
16928
|
+
"../../packages/shared/src/suggested-task.ts"() {
|
|
16929
|
+
"use strict";
|
|
16930
|
+
init_tool_ui();
|
|
16931
|
+
SUGGEST_TASK_TOOL_NAME = "session_suggest_task";
|
|
16932
|
+
}
|
|
16933
|
+
});
|
|
16934
|
+
|
|
16827
16935
|
// ../../packages/chat-core/src/ports.ts
|
|
16828
16936
|
function createStreamingToolInputState() {
|
|
16829
16937
|
return {
|
|
@@ -16963,6 +17071,49 @@ var init_codex_pure = __esm({
|
|
|
16963
17071
|
}
|
|
16964
17072
|
});
|
|
16965
17073
|
|
|
17074
|
+
// ../../packages/shared/src/codex-async-question.ts
|
|
17075
|
+
function isCodexAsyncAnswer(message) {
|
|
17076
|
+
return message.role === "user" && message.id.startsWith("codex_async_answer:");
|
|
17077
|
+
}
|
|
17078
|
+
function codexAsyncQuestionRequest(item) {
|
|
17079
|
+
return {
|
|
17080
|
+
requestId: codexAsyncAnswerId(item.id),
|
|
17081
|
+
questions: (item.questions ?? []).map((question, index) => ({
|
|
17082
|
+
id: String(index),
|
|
17083
|
+
question: question.title,
|
|
17084
|
+
header: question.title,
|
|
17085
|
+
multiSelect: false,
|
|
17086
|
+
options: (question.options ?? []).map((label) => ({ label, description: "" }))
|
|
17087
|
+
}))
|
|
17088
|
+
};
|
|
17089
|
+
}
|
|
17090
|
+
function pendingCodexAsyncQuestions(messages) {
|
|
17091
|
+
const answered = new Set(messages.filter(isCodexAsyncAnswer).map((message) => message.id));
|
|
17092
|
+
const seen = /* @__PURE__ */ new Set();
|
|
17093
|
+
const pending2 = [];
|
|
17094
|
+
for (const message of messages) {
|
|
17095
|
+
if (message.role !== "assistant") continue;
|
|
17096
|
+
for (const item of message.metadata?.codex?.items ?? []) {
|
|
17097
|
+
if (item.type !== "agent_message" || !item.questions?.length || seen.has(item.id)) continue;
|
|
17098
|
+
seen.add(item.id);
|
|
17099
|
+
if (!answered.has(codexAsyncAnswerId(item.id))) pending2.push({ messageId: message.id, item, request: codexAsyncQuestionRequest(item) });
|
|
17100
|
+
}
|
|
17101
|
+
}
|
|
17102
|
+
return pending2;
|
|
17103
|
+
}
|
|
17104
|
+
function codexAsyncQuestionQueue(session) {
|
|
17105
|
+
const pending2 = session.pendingAsyncQuestions ?? pendingCodexAsyncQuestions(session.messages);
|
|
17106
|
+
const answered = new Set(session.messages.filter(isCodexAsyncAnswer).map((message) => message.id));
|
|
17107
|
+
return pending2.some((q2) => answered.has(q2.request.requestId)) ? pending2.filter((q2) => !answered.has(q2.request.requestId)) : pending2;
|
|
17108
|
+
}
|
|
17109
|
+
var codexAsyncAnswerId;
|
|
17110
|
+
var init_codex_async_question = __esm({
|
|
17111
|
+
"../../packages/shared/src/codex-async-question.ts"() {
|
|
17112
|
+
"use strict";
|
|
17113
|
+
codexAsyncAnswerId = (itemId) => `codex_async_answer:${itemId}`;
|
|
17114
|
+
}
|
|
17115
|
+
});
|
|
17116
|
+
|
|
16966
17117
|
// ../../packages/chat-core/src/codex.ts
|
|
16967
17118
|
function applyCodexItemPatch(item, patch) {
|
|
16968
17119
|
switch (item.type) {
|
|
@@ -17059,8 +17210,12 @@ function reduceCodex(session, event, ports2 = defaultChatCorePorts) {
|
|
|
17059
17210
|
return { lastEventAt: ports2.now() };
|
|
17060
17211
|
}
|
|
17061
17212
|
const todoUpdate = codexTodoListFromItem(event.item);
|
|
17213
|
+
const question = event.item.type === "agent_message" && event.item.questions?.length && !session.messages.some((message) => message.id === codexAsyncAnswerId(event.item.id)) ? { messageId: event.messageId, item: event.item, request: codexAsyncQuestionRequest(event.item) } : null;
|
|
17214
|
+
const pendingAsyncQuestions = question ? codexAsyncQuestionQueue(session) : [];
|
|
17215
|
+
const index = question ? pendingAsyncQuestions.findIndex((q2) => q2.item.id === question.item.id) : -1;
|
|
17062
17216
|
return {
|
|
17063
17217
|
lastEventAt: ports2.now(),
|
|
17218
|
+
...question ? { pendingAsyncQuestions: index < 0 ? [...pendingAsyncQuestions, question] : pendingAsyncQuestions.map((q2, i) => i === index ? question : q2) } : {},
|
|
17064
17219
|
...todoUpdate !== void 0 ? { _latestCodexTodoList: todoUpdate } : {},
|
|
17065
17220
|
messages: session.messages.map((msg) => {
|
|
17066
17221
|
if (msg.id !== event.messageId) return msg;
|
|
@@ -17117,6 +17272,7 @@ var init_codex = __esm({
|
|
|
17117
17272
|
init_event_seq_utils();
|
|
17118
17273
|
init_helpers();
|
|
17119
17274
|
init_codex_pure();
|
|
17275
|
+
init_codex_async_question();
|
|
17120
17276
|
init_codex_metadata();
|
|
17121
17277
|
init_ports();
|
|
17122
17278
|
}
|
|
@@ -17667,8 +17823,10 @@ function reduceLifecycle(session, event, ports2 = defaultChatCorePorts) {
|
|
|
17667
17823
|
return changed ? { messages } : {};
|
|
17668
17824
|
}
|
|
17669
17825
|
case "user_message_appended": {
|
|
17670
|
-
|
|
17826
|
+
const pendingAsyncQuestions = session.pendingAsyncQuestions?.filter((q2) => q2.request.requestId !== event.message.id);
|
|
17827
|
+
if (session.messages.some((m3) => m3.id === event.message.id)) return pendingAsyncQuestions ? { pendingAsyncQuestions } : {};
|
|
17671
17828
|
return {
|
|
17829
|
+
...pendingAsyncQuestions ? { pendingAsyncQuestions } : {},
|
|
17672
17830
|
// A backend-originated Codex row (the voice agent's delegation prompt)
|
|
17673
17831
|
// takes its timeline order from the event like an assistant start does,
|
|
17674
17832
|
// and lands ahead of the assistant row of the turn it opened.
|
|
@@ -19034,6 +19192,8 @@ function applyEventToSession(session, event, ports2 = defaultChatCorePorts) {
|
|
|
19034
19192
|
return reduceContentDelta(session, event, ports2);
|
|
19035
19193
|
case "mcp_app_updated":
|
|
19036
19194
|
return { messages: updateMcpAppAttachments(session.messages, event.appInstanceId, event.update) };
|
|
19195
|
+
case "suggested_task_updated":
|
|
19196
|
+
return { messages: applySuggestedTaskUpdate(session.messages, event.taskId, event.state) };
|
|
19037
19197
|
case "todos_updated":
|
|
19038
19198
|
return reduceTodosUpdated(session, event);
|
|
19039
19199
|
case "message_complete":
|
|
@@ -19200,6 +19360,7 @@ var init_reducer = __esm({
|
|
|
19200
19360
|
"use strict";
|
|
19201
19361
|
init_codex_metadata2();
|
|
19202
19362
|
init_mcp_apps_state();
|
|
19363
|
+
init_suggested_task();
|
|
19203
19364
|
init_ports();
|
|
19204
19365
|
init_codex();
|
|
19205
19366
|
init_content();
|
|
@@ -19533,8 +19694,8 @@ var init_read_model = __esm({
|
|
|
19533
19694
|
return loaded2;
|
|
19534
19695
|
}
|
|
19535
19696
|
this.evictIdle();
|
|
19536
|
-
const
|
|
19537
|
-
const providerId =
|
|
19697
|
+
const record12 = this.records.get(sessionId);
|
|
19698
|
+
const providerId = record12?.harnessId ?? "claude";
|
|
19538
19699
|
const mapper = createNodeSessionEventMapper({ sessionId, providerId });
|
|
19539
19700
|
const checkpoint = this.db.prepare(`SELECT applied_version, state_json FROM session_read_models WHERE session_id = ?`).get(sessionId);
|
|
19540
19701
|
let session;
|
|
@@ -19555,13 +19716,13 @@ var init_read_model = __esm({
|
|
|
19555
19716
|
return session;
|
|
19556
19717
|
}
|
|
19557
19718
|
const events = this.log.listForSession(sessionId, Number.MAX_SAFE_INTEGER);
|
|
19558
|
-
const pending2 = nodePendingInteractionFields(
|
|
19719
|
+
const pending2 = nodePendingInteractionFields(record12?.pendingInteraction);
|
|
19559
19720
|
const core = {
|
|
19560
19721
|
...createDefaultChatCoreSession(),
|
|
19561
19722
|
sessionProvider: providerId,
|
|
19562
19723
|
preferredProvider: providerId,
|
|
19563
|
-
messages:
|
|
19564
|
-
status:
|
|
19724
|
+
messages: record12 ? sessionMessageBlocksToChatMessages(buildSessionMessageCatalog(record12, events), providerId) : [],
|
|
19725
|
+
status: record12?.status === "streaming" ? "streaming" : "idle",
|
|
19565
19726
|
...pending2
|
|
19566
19727
|
};
|
|
19567
19728
|
session = {
|
|
@@ -30938,21 +31099,26 @@ var init_account_store = __esm({
|
|
|
30938
31099
|
});
|
|
30939
31100
|
|
|
30940
31101
|
// ../../packages/codex/src/protocol-v162.ts
|
|
30941
|
-
function
|
|
31102
|
+
function record7(value) {
|
|
30942
31103
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
30943
31104
|
}
|
|
30944
31105
|
function string(value) {
|
|
30945
31106
|
return typeof value === "string" && value.trim() ? value : void 0;
|
|
30946
31107
|
}
|
|
30947
31108
|
function readCodexTurnProvenance(raw, threadId) {
|
|
30948
|
-
const turn =
|
|
31109
|
+
const turn = record7(raw);
|
|
30949
31110
|
const turnId = string(turn?.id);
|
|
30950
31111
|
if (!turnId) return null;
|
|
30951
31112
|
const rootTurnId = string(turn?.rootTurnId);
|
|
30952
31113
|
return { threadId, turnId, ...rootTurnId ? { rootTurnId } : turn?.rootTurnId === null ? { rootTurnId: null } : {} };
|
|
30953
31114
|
}
|
|
31115
|
+
function isCodexReviewWorkerTurn(raw, reviewTurnId) {
|
|
31116
|
+
const turn = record7(raw);
|
|
31117
|
+
const turnId = string(turn?.id);
|
|
31118
|
+
return Boolean(reviewTurnId && turnId && turnId !== reviewTurnId && string(turn?.rootTurnId) === reviewTurnId);
|
|
31119
|
+
}
|
|
30954
31120
|
function readCodexSubagentActivity(raw, sourceThreadId, sourceTurnId) {
|
|
30955
|
-
const item =
|
|
31121
|
+
const item = record7(raw);
|
|
30956
31122
|
if (item?.type !== "subAgentActivity") return null;
|
|
30957
31123
|
const id = string(item.id), agentThreadId = string(item.agentThreadId);
|
|
30958
31124
|
const kind = item.kind;
|
|
@@ -31263,9 +31429,9 @@ function mapCodexCollabItem(rec, previous) {
|
|
|
31263
31429
|
const receivers = [...new Set(candidates.filter((entry2) => Boolean(entry2)))];
|
|
31264
31430
|
const receiverThreadIds = receivers.length ? receivers : prior?.receiverThreadIds ?? [];
|
|
31265
31431
|
const agentsStates = { ...prior?.agentsStates };
|
|
31266
|
-
const rawStates =
|
|
31432
|
+
const rawStates = record8(rec.agentsStates ?? rec.agents_states);
|
|
31267
31433
|
const rawStatus = rec.agentStatus ?? rec.agent_status;
|
|
31268
|
-
const rawAgent =
|
|
31434
|
+
const rawAgent = record8(rawStatus);
|
|
31269
31435
|
const apply = (agentId, state) => {
|
|
31270
31436
|
const previousState = prior?.agentsStates[agentId];
|
|
31271
31437
|
agentsStates[agentId] = {
|
|
@@ -31275,7 +31441,7 @@ function mapCodexCollabItem(rec, previous) {
|
|
|
31275
31441
|
};
|
|
31276
31442
|
};
|
|
31277
31443
|
if (rawStates) for (const [agentId, value] of Object.entries(rawStates)) {
|
|
31278
|
-
const state =
|
|
31444
|
+
const state = record8(value);
|
|
31279
31445
|
if (state) apply(agentId, state);
|
|
31280
31446
|
}
|
|
31281
31447
|
if (!rawStates && rawStatus != null) for (const agentId of receiverThreadIds) apply(agentId, { ...rawAgent, status: rawAgent?.status ?? rawStatus });
|
|
@@ -31303,13 +31469,13 @@ function mapCodexCollabItem(rec, previous) {
|
|
|
31303
31469
|
...prior?.childItems ? { childItems: prior.childItems } : {}
|
|
31304
31470
|
};
|
|
31305
31471
|
}
|
|
31306
|
-
var
|
|
31472
|
+
var record8, string2, strings2;
|
|
31307
31473
|
var init_collab_item = __esm({
|
|
31308
31474
|
"../../packages/codex/src/collab-item.ts"() {
|
|
31309
31475
|
"use strict";
|
|
31310
31476
|
init_codex_metadata();
|
|
31311
31477
|
init_protocol_v162();
|
|
31312
|
-
|
|
31478
|
+
record8 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
31313
31479
|
string2 = (value) => typeof value === "string" && value.trim() ? value : void 0;
|
|
31314
31480
|
strings2 = (value) => Array.isArray(value) ? value.filter((entry2) => Boolean(string2(entry2))) : [];
|
|
31315
31481
|
}
|
|
@@ -31397,23 +31563,23 @@ var init_protocol_v154 = __esm({
|
|
|
31397
31563
|
function codexToolResult(result2) {
|
|
31398
31564
|
return {
|
|
31399
31565
|
content: Array.isArray(result2.content) ? result2.content : [],
|
|
31400
|
-
...
|
|
31401
|
-
...
|
|
31566
|
+
...record9(result2.structuredContent) ? { structuredContent: record9(result2.structuredContent) } : {},
|
|
31567
|
+
...record9(result2._meta) ? { _meta: record9(result2._meta) } : {},
|
|
31402
31568
|
...typeof result2.isError === "boolean" ? { isError: result2.isError } : {}
|
|
31403
31569
|
};
|
|
31404
31570
|
}
|
|
31405
31571
|
function codexTruncatedResultBytes(result2) {
|
|
31406
31572
|
if (result2.structuredContent != null || result2.meta != null || result2.content.length !== 1) return void 0;
|
|
31407
|
-
const block =
|
|
31573
|
+
const block = record9(result2.content[0]);
|
|
31408
31574
|
if (block?.type !== "text" || typeof block.text !== "string" || !block.text.startsWith('{"content":')) return void 0;
|
|
31409
31575
|
const removed = CODEX_TRUNCATION_MARKER.exec(block.text)?.[1];
|
|
31410
31576
|
return removed === void 0 ? void 0 : new TextEncoder().encode(block.text).byteLength + Number(removed);
|
|
31411
31577
|
}
|
|
31412
31578
|
function readCodexMcpAppFields(raw, previous) {
|
|
31413
|
-
const ui2 =
|
|
31579
|
+
const ui2 = record9(raw.mcpAppUi) ?? (typeof raw.mcpAppResourceUri === "string" ? { resourceUri: raw.mcpAppResourceUri } : void 0);
|
|
31414
31580
|
return {
|
|
31415
31581
|
...typeof ui2?.resourceUri === "string" ? { mcpAppUi: { resourceUri: ui2.resourceUri, ...typeof ui2.preferredModelDisplayMode === "string" ? { preferredModelDisplayMode: ui2.preferredModelDisplayMode } : {} } } : previous?.mcpAppUi ? { mcpAppUi: previous.mcpAppUi } : {},
|
|
31416
|
-
..."appContext" in raw ? { appContext:
|
|
31582
|
+
..."appContext" in raw ? { appContext: record9(raw.appContext) ?? null } : previous && "appContext" in previous ? { appContext: previous.appContext } : {},
|
|
31417
31583
|
...previous?.app ? { app: previous.app } : {}
|
|
31418
31584
|
};
|
|
31419
31585
|
}
|
|
@@ -31430,7 +31596,7 @@ function attachCodexMcpApp(item, binding, threadId) {
|
|
|
31430
31596
|
harnessCallId: item.id,
|
|
31431
31597
|
resourceUri: uri,
|
|
31432
31598
|
toolName: item.tool,
|
|
31433
|
-
...
|
|
31599
|
+
...record9(item.arguments) ? { toolInput: record9(item.arguments) } : {},
|
|
31434
31600
|
...truncated !== void 0 ? { toolResult: void 0, toolResultOmitted: { bytes: truncated, reason: "size_limit" } } : item.result ? { toolResult: codexToolResult({ content: item.result.content, structuredContent: item.result.structuredContent, _meta: item.result.meta, isError: item.result.isError }) } : {},
|
|
31435
31601
|
status: status2,
|
|
31436
31602
|
...item.authRequired ? { error: { code: "auth_required", message: "MCP authentication required", challenge: challenges(readCodexMcpWwwAuthenticate(item.result?.meta)) } } : item.error ? { error: { code: "invalid", message: item.error.message } } : {}
|
|
@@ -31462,7 +31628,7 @@ function createCodexMcpAppsProvider(binding, threadId, request, connectionKey =
|
|
|
31462
31628
|
try {
|
|
31463
31629
|
const result2 = await request(method, { ...params, threadId, server: binding.server });
|
|
31464
31630
|
if (signal?.aborted) throw new McpAppsError(mutates ? "unknown_outcome" : "cancelled", "MCP App request cancelled after dispatch");
|
|
31465
|
-
const challenge = challenges(readCodexMcpWwwAuthenticate(
|
|
31631
|
+
const challenge = challenges(readCodexMcpWwwAuthenticate(record9(result2._meta)));
|
|
31466
31632
|
if (challenge !== void 0) throw new McpAppsError("auth_required", "MCP authentication required", challenge);
|
|
31467
31633
|
assertMcpAppSize(result2, maxBytes);
|
|
31468
31634
|
return result2;
|
|
@@ -31478,7 +31644,7 @@ function createCodexMcpAppsProvider(binding, threadId, request, connectionKey =
|
|
|
31478
31644
|
const output = [];
|
|
31479
31645
|
for (let page2 = 0; page2 < 100; page2++) {
|
|
31480
31646
|
const result2 = await invoke("mcpServerStatus/list", { detail, ...cursor ? { cursor } : {} });
|
|
31481
|
-
output.push(...(Array.isArray(result2.data) ? result2.data : []).map(
|
|
31647
|
+
output.push(...(Array.isArray(result2.data) ? result2.data : []).map(record9).filter((s4) => !!s4));
|
|
31482
31648
|
cursor = result2.nextCursor;
|
|
31483
31649
|
if (!cursor) return output;
|
|
31484
31650
|
}
|
|
@@ -31492,10 +31658,10 @@ function createCodexMcpAppsProvider(binding, threadId, request, connectionKey =
|
|
|
31492
31658
|
invalidateCodexMcpAppsCatalog(connectionKey);
|
|
31493
31659
|
throw new McpAppsError("auth_required", "MCP authentication required");
|
|
31494
31660
|
}
|
|
31495
|
-
const entries =
|
|
31661
|
+
const entries = record9(server?.tools);
|
|
31496
31662
|
for (const [name, value] of Object.entries(entries ?? {})) {
|
|
31497
|
-
const tool2 =
|
|
31498
|
-
const info =
|
|
31663
|
+
const tool2 = record9(value);
|
|
31664
|
+
const info = record9(server?.serverInfo);
|
|
31499
31665
|
if (tool2) output.set(name, { ...tool2, name, serverInfo: {
|
|
31500
31666
|
...typeof info?.title === "string" ? { title: info.title } : {},
|
|
31501
31667
|
...Array.isArray(info?.icons) ? { icons: info.icons } : {}
|
|
@@ -31517,21 +31683,21 @@ function createCodexMcpAppsProvider(binding, threadId, request, connectionKey =
|
|
|
31517
31683
|
guard(signal, req.origin);
|
|
31518
31684
|
const result2 = await invoke("mcpServer/resource/read", { uri: req.uri }, signal, req.origin, false, req.transient ? MCP_APP_OUTPUT_MAX_BYTES : MCP_APP_HTML_MAX_BYTES + MCP_APP_DATA_MAX_BYTES);
|
|
31519
31685
|
const rawContents = Array.isArray(result2.contents) ? result2.contents : [];
|
|
31520
|
-
if (!document) return { contents: rawContents, ...
|
|
31686
|
+
if (!document) return { contents: rawContents, ...record9(result2._meta) ? { _meta: record9(result2._meta) } : {} };
|
|
31521
31687
|
let listMeta;
|
|
31522
|
-
if (rawContents.some((value) =>
|
|
31688
|
+
if (rawContents.some((value) => record9(value)?.uri === req.uri && !record9(record9(record9(value)?._meta)?.ui))) {
|
|
31523
31689
|
const server = (await catalog("full")).find((entry2) => entry2.name === binding.server);
|
|
31524
|
-
const resource = (Array.isArray(server?.resources) ? server.resources : []).map(
|
|
31525
|
-
listMeta =
|
|
31690
|
+
const resource = (Array.isArray(server?.resources) ? server.resources : []).map(record9).find((entry2) => entry2?.uri === req.uri);
|
|
31691
|
+
listMeta = record9(resource?._meta);
|
|
31526
31692
|
}
|
|
31527
31693
|
const contents = rawContents.map((value) => {
|
|
31528
31694
|
const content = value;
|
|
31529
|
-
const meta3 =
|
|
31530
|
-
if (
|
|
31531
|
-
const ui2 = { ...
|
|
31695
|
+
const meta3 = record9(content._meta);
|
|
31696
|
+
if (record9(meta3?.ui)) return content;
|
|
31697
|
+
const ui2 = { ...record9(listMeta?.ui), ...record9(meta3?.ui) };
|
|
31532
31698
|
return { ...content, ...listMeta || meta3 ? { _meta: { ...listMeta, ...meta3, ui: ui2 } } : {} };
|
|
31533
31699
|
});
|
|
31534
|
-
return { contents, ...
|
|
31700
|
+
return { contents, ...record9(result2._meta) ? { _meta: record9(result2._meta) } : {} };
|
|
31535
31701
|
},
|
|
31536
31702
|
async callTool(req, signal) {
|
|
31537
31703
|
assertMcpAppSize(req.args);
|
|
@@ -31550,7 +31716,7 @@ function createCodexMcpAppsProvider(binding, threadId, request, connectionKey =
|
|
|
31550
31716
|
}
|
|
31551
31717
|
};
|
|
31552
31718
|
}
|
|
31553
|
-
var challenges,
|
|
31719
|
+
var challenges, record9, CODEX_TRUNCATION_MARKER;
|
|
31554
31720
|
var init_mcp_apps2 = __esm({
|
|
31555
31721
|
"../../packages/codex/src/mcp-apps.ts"() {
|
|
31556
31722
|
"use strict";
|
|
@@ -31558,7 +31724,7 @@ var init_mcp_apps2 = __esm({
|
|
|
31558
31724
|
init_protocol_v154();
|
|
31559
31725
|
init_mcp_apps_catalog2();
|
|
31560
31726
|
challenges = (value) => value === void 0 ? void 0 : Array.isArray(value) ? value.map(String) : [String(value)];
|
|
31561
|
-
|
|
31727
|
+
record9 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
31562
31728
|
CODEX_TRUNCATION_MARKER = /…(\d+) (?:chars|tokens) truncated…/;
|
|
31563
31729
|
}
|
|
31564
31730
|
});
|
|
@@ -32684,11 +32850,13 @@ async function runCodexAppServerTurn(opts) {
|
|
|
32684
32850
|
sandboxPolicy: buildCodexWorkspaceWriteSandboxPolicy(opts.cwd, opts.additionalDirectories)
|
|
32685
32851
|
});
|
|
32686
32852
|
opts.onInputAccepted?.();
|
|
32687
|
-
await opts.client.request("review/start", compactRecord({
|
|
32853
|
+
const reviewStartResult = await opts.client.request("review/start", compactRecord({
|
|
32688
32854
|
threadId,
|
|
32689
32855
|
delivery: "inline",
|
|
32690
32856
|
target: opts.reviewTarget ?? { type: "uncommittedChanges" }
|
|
32691
32857
|
}));
|
|
32858
|
+
initialTurn = asRecord9(reviewStartResult.turn);
|
|
32859
|
+
turnId = readString4(initialTurn?.id);
|
|
32692
32860
|
} else {
|
|
32693
32861
|
const collaborationMode = normalizeCollaborationMode(
|
|
32694
32862
|
opts.collaborationMode,
|
|
@@ -32738,6 +32906,9 @@ async function runCodexAppServerTurn(opts) {
|
|
|
32738
32906
|
if (opts.signal.aborted) break;
|
|
32739
32907
|
continue;
|
|
32740
32908
|
}
|
|
32909
|
+
if (turnKind === "review" && note.method === "turn/started" && isCodexReviewWorkerTurn(note.params.turn, turnId)) {
|
|
32910
|
+
continue;
|
|
32911
|
+
}
|
|
32741
32912
|
if (note.method === "turn/completed" || note.method === "turn/completed/v2") {
|
|
32742
32913
|
const completedTurn = asRecord9(note.params.turn);
|
|
32743
32914
|
const completedId = readString4(completedTurn?.id);
|
|
@@ -33723,7 +33894,7 @@ function blockRefsOf(content) {
|
|
|
33723
33894
|
function createRetractionLedger() {
|
|
33724
33895
|
const byUuid = /* @__PURE__ */ new Map();
|
|
33725
33896
|
let currentMessageId = "";
|
|
33726
|
-
const
|
|
33897
|
+
const record12 = (uuid3, messageId, content) => {
|
|
33727
33898
|
const key = str2(uuid3);
|
|
33728
33899
|
if (!key) return;
|
|
33729
33900
|
if (messageId !== currentMessageId) {
|
|
@@ -33734,8 +33905,8 @@ function createRetractionLedger() {
|
|
|
33734
33905
|
if (blocks.length > 0) byUuid.set(key, { messageId, blocks });
|
|
33735
33906
|
};
|
|
33736
33907
|
return {
|
|
33737
|
-
recordAssistantFrame:
|
|
33738
|
-
recordToolResultFrame:
|
|
33908
|
+
recordAssistantFrame: record12,
|
|
33909
|
+
recordToolResultFrame: record12,
|
|
33739
33910
|
resolve(uuids) {
|
|
33740
33911
|
if (!Array.isArray(uuids)) return [];
|
|
33741
33912
|
const byMessage = /* @__PURE__ */ new Map();
|
|
@@ -34902,11 +35073,11 @@ function stringifyOutput(content) {
|
|
|
34902
35073
|
}
|
|
34903
35074
|
}
|
|
34904
35075
|
function applySdkMessage(message, state, emit) {
|
|
34905
|
-
const
|
|
34906
|
-
const sessionId = sessionIdOf2(
|
|
34907
|
-
const parentToolUseId = typeof
|
|
34908
|
-
if (
|
|
34909
|
-
const event = asRecord11(
|
|
35076
|
+
const record12 = message;
|
|
35077
|
+
const sessionId = sessionIdOf2(record12);
|
|
35078
|
+
const parentToolUseId = typeof record12.parent_tool_use_id === "string" ? record12.parent_tool_use_id : null;
|
|
35079
|
+
if (record12.type === "stream_event") {
|
|
35080
|
+
const event = asRecord11(record12.event);
|
|
34910
35081
|
if (!event) return emptyApply(sessionId);
|
|
34911
35082
|
const index = typeof event.index === "number" ? event.index : null;
|
|
34912
35083
|
if (event.type === "content_block_start") {
|
|
@@ -34975,8 +35146,8 @@ function applySdkMessage(message, state, emit) {
|
|
|
34975
35146
|
}
|
|
34976
35147
|
return emptyApply(sessionId);
|
|
34977
35148
|
}
|
|
34978
|
-
if (
|
|
34979
|
-
const messageBody = asRecord11(
|
|
35149
|
+
if (record12.type === "assistant") {
|
|
35150
|
+
const messageBody = asRecord11(record12.message);
|
|
34980
35151
|
const content = messageBody && Array.isArray(messageBody.content) ? messageBody.content : [];
|
|
34981
35152
|
for (const raw of content) {
|
|
34982
35153
|
const block = asRecord11(raw);
|
|
@@ -35005,8 +35176,8 @@ function applySdkMessage(message, state, emit) {
|
|
|
35005
35176
|
}
|
|
35006
35177
|
return emptyApply(sessionId);
|
|
35007
35178
|
}
|
|
35008
|
-
if (
|
|
35009
|
-
const messageBody = asRecord11(
|
|
35179
|
+
if (record12.type === "user") {
|
|
35180
|
+
const messageBody = asRecord11(record12.message);
|
|
35010
35181
|
const content = messageBody && Array.isArray(messageBody.content) ? messageBody.content : [];
|
|
35011
35182
|
for (const raw of content) {
|
|
35012
35183
|
const block = asRecord11(raw);
|
|
@@ -35030,12 +35201,12 @@ function applySdkMessage(message, state, emit) {
|
|
|
35030
35201
|
}
|
|
35031
35202
|
return emptyApply(sessionId);
|
|
35032
35203
|
}
|
|
35033
|
-
if (
|
|
35034
|
-
const resultIsError =
|
|
35035
|
-
const resultText = typeof
|
|
35204
|
+
if (record12.type === "result") {
|
|
35205
|
+
const resultIsError = record12.is_error === true || record12.subtype === "error";
|
|
35206
|
+
const resultText = typeof record12.result === "string" ? record12.result : null;
|
|
35036
35207
|
let resultError = null;
|
|
35037
35208
|
if (resultIsError) {
|
|
35038
|
-
resultError = resultText || (typeof
|
|
35209
|
+
resultError = resultText || (typeof record12.errors === "string" ? record12.errors : null) || "Claude turn failed";
|
|
35039
35210
|
}
|
|
35040
35211
|
for (const open2 of state.openTools.values()) {
|
|
35041
35212
|
if (open2.completed) continue;
|
|
@@ -35101,13 +35272,13 @@ function toMcpToolDescriptor(tool2) {
|
|
|
35101
35272
|
};
|
|
35102
35273
|
}
|
|
35103
35274
|
function claudeMcpToolResult(raw, isError, blockContent) {
|
|
35104
|
-
const rec =
|
|
35275
|
+
const rec = record10(raw);
|
|
35105
35276
|
if (!rec || !("content" in rec) && blockContent === void 0) return void 0;
|
|
35106
35277
|
const content = contentBlocks("content" in rec ? rec.content : blockContent);
|
|
35107
35278
|
return {
|
|
35108
35279
|
content,
|
|
35109
35280
|
...rec.structuredContent !== void 0 ? { structuredContent: rec.structuredContent } : {},
|
|
35110
|
-
...
|
|
35281
|
+
...record10(rec._meta) ? { _meta: record10(rec._meta) } : {},
|
|
35111
35282
|
...isError ? { isError: true } : {}
|
|
35112
35283
|
};
|
|
35113
35284
|
}
|
|
@@ -35230,7 +35401,7 @@ function createClaudeMcpAppsProvider(binding, deps) {
|
|
|
35230
35401
|
}
|
|
35231
35402
|
};
|
|
35232
35403
|
}
|
|
35233
|
-
var CLAUDE_MCP_APPS_HOST_ENV, ClaudeMcpAppsCatalog,
|
|
35404
|
+
var CLAUDE_MCP_APPS_HOST_ENV, ClaudeMcpAppsCatalog, record10, contentBlocks, ClaudeToolApps, errorMessage;
|
|
35234
35405
|
var init_mcp_apps3 = __esm({
|
|
35235
35406
|
"../../packages/claude/src/mcp-apps.ts"() {
|
|
35236
35407
|
"use strict";
|
|
@@ -35311,7 +35482,7 @@ var init_mcp_apps3 = __esm({
|
|
|
35311
35482
|
return best && { server: best.server, tool: best.tool };
|
|
35312
35483
|
}
|
|
35313
35484
|
};
|
|
35314
|
-
|
|
35485
|
+
record10 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
35315
35486
|
contentBlocks = (content) => typeof content === "string" ? [{ type: "text", text: content }] : Array.isArray(content) ? content : [];
|
|
35316
35487
|
ClaudeToolApps = class {
|
|
35317
35488
|
constructor(opts) {
|
|
@@ -35323,7 +35494,7 @@ var init_mcp_apps3 = __esm({
|
|
|
35323
35494
|
/** Complete `tool_use` block: the View can mount and receive `tool-input`. */
|
|
35324
35495
|
toolUse(toolUseId, toolName, input) {
|
|
35325
35496
|
if (!toolName.startsWith("mcp__")) return void 0;
|
|
35326
|
-
const call = { toolName, input:
|
|
35497
|
+
const call = { toolName, input: record10(input) };
|
|
35327
35498
|
this.calls.set(toolUseId, call);
|
|
35328
35499
|
return this.attachment(toolUseId, call, { status: "pending" });
|
|
35329
35500
|
}
|
|
@@ -35473,15 +35644,15 @@ async function resolveAskUserQuestion(params) {
|
|
|
35473
35644
|
toolUseId,
|
|
35474
35645
|
input: baseInput ?? void 0
|
|
35475
35646
|
});
|
|
35476
|
-
const
|
|
35477
|
-
const answers =
|
|
35647
|
+
const record12 = asRecord12(answer);
|
|
35648
|
+
const answers = record12 && "answers" in record12 ? record12.answers : answer;
|
|
35478
35649
|
const answerMap = asRecord12(answers);
|
|
35479
35650
|
const updatedInput = {
|
|
35480
35651
|
...baseInput,
|
|
35481
35652
|
...buildAnsweredQuestionInput({
|
|
35482
35653
|
questions: Array.isArray(baseInput?.questions) ? baseInput.questions : [],
|
|
35483
35654
|
answers: answerMap ?? {},
|
|
35484
|
-
annotations:
|
|
35655
|
+
annotations: record12?.annotations,
|
|
35485
35656
|
previewFormat
|
|
35486
35657
|
}),
|
|
35487
35658
|
// Preserve the host's answer shape verbatim — it is not always a record.
|
|
@@ -60072,7 +60243,7 @@ __export(schemas_exports2, {
|
|
|
60072
60243
|
preprocess: () => preprocess,
|
|
60073
60244
|
promise: () => promise,
|
|
60074
60245
|
readonly: () => readonly,
|
|
60075
|
-
record: () =>
|
|
60246
|
+
record: () => record11,
|
|
60076
60247
|
refine: () => refine,
|
|
60077
60248
|
set: () => set,
|
|
60078
60249
|
strictObject: () => strictObject,
|
|
@@ -60358,7 +60529,7 @@ function tuple(items, _paramsOrRest, _params) {
|
|
|
60358
60529
|
...util_exports.normalizeParams(params)
|
|
60359
60530
|
});
|
|
60360
60531
|
}
|
|
60361
|
-
function
|
|
60532
|
+
function record11(keyType, valueType, params) {
|
|
60362
60533
|
if (!valueType || !valueType._zod) {
|
|
60363
60534
|
return new ZodRecord({
|
|
60364
60535
|
type: "record",
|
|
@@ -60601,7 +60772,7 @@ function _instanceof(cls, params = {}) {
|
|
|
60601
60772
|
}
|
|
60602
60773
|
function json2(params) {
|
|
60603
60774
|
const jsonSchema = lazy(() => {
|
|
60604
|
-
return union([string5(params), number3(), boolean2(), _null3(), array(jsonSchema),
|
|
60775
|
+
return union([string5(params), number3(), boolean2(), _null3(), array(jsonSchema), record11(string5(), jsonSchema)]);
|
|
60605
60776
|
});
|
|
60606
60777
|
return jsonSchema;
|
|
60607
60778
|
}
|
|
@@ -62146,7 +62317,7 @@ __export(external_exports, {
|
|
|
62146
62317
|
promise: () => promise,
|
|
62147
62318
|
property: () => _property,
|
|
62148
62319
|
readonly: () => readonly,
|
|
62149
|
-
record: () =>
|
|
62320
|
+
record: () => record11,
|
|
62150
62321
|
refine: () => refine,
|
|
62151
62322
|
regex: () => _regex,
|
|
62152
62323
|
regexes: () => regexes_exports,
|
|
@@ -62311,7 +62482,7 @@ var init_zod_gen = __esm({
|
|
|
62311
62482
|
sessionId: zSessionId,
|
|
62312
62483
|
path: string5(),
|
|
62313
62484
|
content: string5(),
|
|
62314
|
-
_meta: defaultOnError(
|
|
62485
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62315
62486
|
});
|
|
62316
62487
|
zReadTextFileRequest = object({
|
|
62317
62488
|
sessionId: zSessionId,
|
|
@@ -62322,7 +62493,7 @@ var init_zod_gen = __esm({
|
|
|
62322
62493
|
limit: defaultOnError(int().gte(0).max(4294967295, {
|
|
62323
62494
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
62324
62495
|
}).nullish(), () => void 0),
|
|
62325
|
-
_meta: defaultOnError(
|
|
62496
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62326
62497
|
});
|
|
62327
62498
|
zToolCallId = string5();
|
|
62328
62499
|
zToolKind = union([
|
|
@@ -62348,25 +62519,25 @@ var init_zod_gen = __esm({
|
|
|
62348
62519
|
audience: defaultOnError(vecSkipError(zRole).nullish(), () => void 0),
|
|
62349
62520
|
lastModified: defaultOnError(string5().nullish(), () => void 0),
|
|
62350
62521
|
priority: defaultOnError(number3().nullish(), () => void 0),
|
|
62351
|
-
_meta: defaultOnError(
|
|
62522
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62352
62523
|
});
|
|
62353
62524
|
zTextContent = object({
|
|
62354
62525
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
62355
62526
|
text: string5(),
|
|
62356
|
-
_meta: defaultOnError(
|
|
62527
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62357
62528
|
});
|
|
62358
62529
|
zImageContent = object({
|
|
62359
62530
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
62360
62531
|
data: string5(),
|
|
62361
62532
|
mimeType: string5(),
|
|
62362
62533
|
uri: defaultOnError(string5().nullish(), () => void 0),
|
|
62363
|
-
_meta: defaultOnError(
|
|
62534
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62364
62535
|
});
|
|
62365
62536
|
zAudioContent = object({
|
|
62366
62537
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
62367
62538
|
data: string5(),
|
|
62368
62539
|
mimeType: string5(),
|
|
62369
|
-
_meta: defaultOnError(
|
|
62540
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62370
62541
|
});
|
|
62371
62542
|
zResourceLink = object({
|
|
62372
62543
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
@@ -62376,19 +62547,19 @@ var init_zod_gen = __esm({
|
|
|
62376
62547
|
size: defaultOnError(number3().nullish(), () => void 0),
|
|
62377
62548
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
62378
62549
|
uri: string5(),
|
|
62379
|
-
_meta: defaultOnError(
|
|
62550
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62380
62551
|
});
|
|
62381
62552
|
zTextResourceContents = object({
|
|
62382
62553
|
mimeType: defaultOnError(string5().nullish(), () => void 0),
|
|
62383
62554
|
text: string5(),
|
|
62384
62555
|
uri: string5(),
|
|
62385
|
-
_meta: defaultOnError(
|
|
62556
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62386
62557
|
});
|
|
62387
62558
|
zBlobResourceContents = object({
|
|
62388
62559
|
blob: string5(),
|
|
62389
62560
|
mimeType: defaultOnError(string5().nullish(), () => void 0),
|
|
62390
62561
|
uri: string5(),
|
|
62391
|
-
_meta: defaultOnError(
|
|
62562
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62392
62563
|
});
|
|
62393
62564
|
zEmbeddedResourceResource = union([
|
|
62394
62565
|
zTextResourceContents,
|
|
@@ -62397,7 +62568,7 @@ var init_zod_gen = __esm({
|
|
|
62397
62568
|
zEmbeddedResource = object({
|
|
62398
62569
|
annotations: defaultOnError(zAnnotations.nullish(), () => void 0),
|
|
62399
62570
|
resource: zEmbeddedResourceResource,
|
|
62400
|
-
_meta: defaultOnError(
|
|
62571
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62401
62572
|
});
|
|
62402
62573
|
zContentBlock = union([
|
|
62403
62574
|
zTextContent.and(object({
|
|
@@ -62418,18 +62589,18 @@ var init_zod_gen = __esm({
|
|
|
62418
62589
|
]);
|
|
62419
62590
|
zContent = object({
|
|
62420
62591
|
content: zContentBlock,
|
|
62421
|
-
_meta: defaultOnError(
|
|
62592
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62422
62593
|
});
|
|
62423
62594
|
zDiff = object({
|
|
62424
62595
|
path: string5(),
|
|
62425
62596
|
oldText: defaultOnError(string5().nullish(), () => void 0),
|
|
62426
62597
|
newText: string5(),
|
|
62427
|
-
_meta: defaultOnError(
|
|
62598
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62428
62599
|
});
|
|
62429
62600
|
zTerminalId = string5();
|
|
62430
62601
|
zTerminal = object({
|
|
62431
62602
|
terminalId: zTerminalId,
|
|
62432
|
-
_meta: defaultOnError(
|
|
62603
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62433
62604
|
});
|
|
62434
62605
|
zToolCallContent = union([
|
|
62435
62606
|
zContent.and(object({
|
|
@@ -62447,7 +62618,7 @@ var init_zod_gen = __esm({
|
|
|
62447
62618
|
line: defaultOnError(int().gte(0).max(4294967295, {
|
|
62448
62619
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
62449
62620
|
}).nullish(), () => void 0),
|
|
62450
|
-
_meta: defaultOnError(
|
|
62621
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62451
62622
|
});
|
|
62452
62623
|
zToolCallUpdate = object({
|
|
62453
62624
|
toolCallId: zToolCallId,
|
|
@@ -62459,7 +62630,7 @@ var init_zod_gen = __esm({
|
|
|
62459
62630
|
locations: defaultOnError(vecSkipError(zToolCallLocation).nullish(), () => void 0),
|
|
62460
62631
|
rawInput: defaultOnError(unknown().optional(), () => void 0),
|
|
62461
62632
|
rawOutput: defaultOnError(unknown().optional(), () => void 0),
|
|
62462
|
-
_meta: defaultOnError(
|
|
62633
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62463
62634
|
});
|
|
62464
62635
|
zPermissionOptionId = string5();
|
|
62465
62636
|
zPermissionOptionKind = union([
|
|
@@ -62472,18 +62643,18 @@ var init_zod_gen = __esm({
|
|
|
62472
62643
|
optionId: zPermissionOptionId,
|
|
62473
62644
|
name: string5(),
|
|
62474
62645
|
kind: zPermissionOptionKind,
|
|
62475
|
-
_meta: defaultOnError(
|
|
62646
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62476
62647
|
});
|
|
62477
62648
|
zRequestPermissionRequest = object({
|
|
62478
62649
|
sessionId: zSessionId,
|
|
62479
62650
|
toolCall: zToolCallUpdate,
|
|
62480
62651
|
options: array(zPermissionOption),
|
|
62481
|
-
_meta: defaultOnError(
|
|
62652
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62482
62653
|
});
|
|
62483
62654
|
zEnvVariable = object({
|
|
62484
62655
|
name: string5(),
|
|
62485
62656
|
value: string5(),
|
|
62486
|
-
_meta: defaultOnError(
|
|
62657
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62487
62658
|
});
|
|
62488
62659
|
zCreateTerminalRequest = object({
|
|
62489
62660
|
sessionId: zSessionId,
|
|
@@ -62492,27 +62663,27 @@ var init_zod_gen = __esm({
|
|
|
62492
62663
|
env: defaultOnError(vecSkipError(zEnvVariable).optional(), () => []),
|
|
62493
62664
|
cwd: defaultOnError(string5().nullish(), () => void 0),
|
|
62494
62665
|
outputByteLimit: defaultOnError(number3().nullish(), () => void 0),
|
|
62495
|
-
_meta: defaultOnError(
|
|
62666
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62496
62667
|
});
|
|
62497
62668
|
zTerminalOutputRequest = object({
|
|
62498
62669
|
sessionId: zSessionId,
|
|
62499
62670
|
terminalId: zTerminalId,
|
|
62500
|
-
_meta: defaultOnError(
|
|
62671
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62501
62672
|
});
|
|
62502
62673
|
zReleaseTerminalRequest = object({
|
|
62503
62674
|
sessionId: zSessionId,
|
|
62504
62675
|
terminalId: zTerminalId,
|
|
62505
|
-
_meta: defaultOnError(
|
|
62676
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62506
62677
|
});
|
|
62507
62678
|
zWaitForTerminalExitRequest = object({
|
|
62508
62679
|
sessionId: zSessionId,
|
|
62509
62680
|
terminalId: zTerminalId,
|
|
62510
|
-
_meta: defaultOnError(
|
|
62681
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62511
62682
|
});
|
|
62512
62683
|
zKillTerminalRequest = object({
|
|
62513
62684
|
sessionId: zSessionId,
|
|
62514
62685
|
terminalId: zTerminalId,
|
|
62515
|
-
_meta: defaultOnError(
|
|
62686
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62516
62687
|
});
|
|
62517
62688
|
zElicitationSessionScope = object({
|
|
62518
62689
|
sessionId: zSessionId,
|
|
@@ -62532,7 +62703,7 @@ var init_zod_gen = __esm({
|
|
|
62532
62703
|
const: string5(),
|
|
62533
62704
|
title: string5(),
|
|
62534
62705
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62535
|
-
_meta: defaultOnError(
|
|
62706
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62536
62707
|
});
|
|
62537
62708
|
zStringPropertySchema = object({
|
|
62538
62709
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
@@ -62548,7 +62719,7 @@ var init_zod_gen = __esm({
|
|
|
62548
62719
|
default: defaultOnError(string5().nullish(), () => void 0),
|
|
62549
62720
|
enum: array(string5()).nullish(),
|
|
62550
62721
|
oneOf: array(zEnumOption).nullish(),
|
|
62551
|
-
_meta: defaultOnError(
|
|
62722
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62552
62723
|
});
|
|
62553
62724
|
zNumberPropertySchema = object({
|
|
62554
62725
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
@@ -62556,7 +62727,7 @@ var init_zod_gen = __esm({
|
|
|
62556
62727
|
minimum: number3().nullish(),
|
|
62557
62728
|
maximum: number3().nullish(),
|
|
62558
62729
|
default: defaultOnError(number3().nullish(), () => void 0),
|
|
62559
|
-
_meta: defaultOnError(
|
|
62730
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62560
62731
|
});
|
|
62561
62732
|
zIntegerPropertySchema = object({
|
|
62562
62733
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
@@ -62564,21 +62735,21 @@ var init_zod_gen = __esm({
|
|
|
62564
62735
|
minimum: number3().nullish(),
|
|
62565
62736
|
maximum: number3().nullish(),
|
|
62566
62737
|
default: defaultOnError(number3().nullish(), () => void 0),
|
|
62567
|
-
_meta: defaultOnError(
|
|
62738
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62568
62739
|
});
|
|
62569
62740
|
zBooleanPropertySchema = object({
|
|
62570
62741
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
62571
62742
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62572
62743
|
default: defaultOnError(boolean2().nullish(), () => void 0),
|
|
62573
|
-
_meta: defaultOnError(
|
|
62744
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62574
62745
|
});
|
|
62575
62746
|
zStringMultiSelectItems = object({
|
|
62576
62747
|
enum: array(string5()),
|
|
62577
|
-
_meta: defaultOnError(
|
|
62748
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62578
62749
|
});
|
|
62579
62750
|
zTitledMultiSelectItems = object({
|
|
62580
62751
|
anyOf: array(zEnumOption),
|
|
62581
|
-
_meta: defaultOnError(
|
|
62752
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62582
62753
|
});
|
|
62583
62754
|
zMultiSelectItems = preserveCustomPayload(union([
|
|
62584
62755
|
zStringMultiSelectItems.and(object({
|
|
@@ -62596,7 +62767,7 @@ var init_zod_gen = __esm({
|
|
|
62596
62767
|
maxItems: number3().nullish(),
|
|
62597
62768
|
items: zMultiSelectItems,
|
|
62598
62769
|
default: defaultOnError(vecSkipError(string5()).nullish(), () => void 0),
|
|
62599
|
-
_meta: defaultOnError(
|
|
62770
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62600
62771
|
});
|
|
62601
62772
|
zElicitationPropertySchema = preserveCustomPayload(union([
|
|
62602
62773
|
zStringPropertySchema.and(object({
|
|
@@ -62621,10 +62792,10 @@ var init_zod_gen = __esm({
|
|
|
62621
62792
|
zElicitationSchema = object({
|
|
62622
62793
|
type: defaultOnError(zElicitationSchemaType.optional().default("object"), () => "object"),
|
|
62623
62794
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
62624
|
-
properties:
|
|
62795
|
+
properties: record11(string5(), zElicitationPropertySchema).optional().default({}),
|
|
62625
62796
|
required: array(string5()).nullish(),
|
|
62626
62797
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62627
|
-
_meta: defaultOnError(
|
|
62798
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62628
62799
|
});
|
|
62629
62800
|
zElicitationFormMode = intersection(union([zElicitationSessionScope, zElicitationRequestScope]), object({
|
|
62630
62801
|
requestedSchema: zElicitationSchema
|
|
@@ -62646,23 +62817,23 @@ var init_zod_gen = __esm({
|
|
|
62646
62817
|
})), "mode", ["form", "url"])
|
|
62647
62818
|
]), object({
|
|
62648
62819
|
message: string5(),
|
|
62649
|
-
_meta: defaultOnError(
|
|
62820
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62650
62821
|
})), "mode", ["form", "url"]);
|
|
62651
62822
|
zMcpServerAcpId = string5();
|
|
62652
62823
|
zConnectMcpRequest = object({
|
|
62653
62824
|
serverId: zMcpServerAcpId,
|
|
62654
|
-
_meta: defaultOnError(
|
|
62825
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62655
62826
|
});
|
|
62656
62827
|
zMcpConnectionId = string5();
|
|
62657
62828
|
zMessageMcpRequest = object({
|
|
62658
62829
|
connectionId: zMcpConnectionId,
|
|
62659
62830
|
method: string5(),
|
|
62660
|
-
params:
|
|
62661
|
-
_meta: defaultOnError(
|
|
62831
|
+
params: record11(string5(), unknown()).nullish(),
|
|
62832
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62662
62833
|
});
|
|
62663
62834
|
zDisconnectMcpRequest = object({
|
|
62664
62835
|
connectionId: zMcpConnectionId,
|
|
62665
|
-
_meta: defaultOnError(
|
|
62836
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62666
62837
|
});
|
|
62667
62838
|
zExtRequest = unknown();
|
|
62668
62839
|
zAgentRequest = object({
|
|
@@ -62689,31 +62860,31 @@ var init_zod_gen = __esm({
|
|
|
62689
62860
|
image: defaultOnError(boolean2().optional().default(false), () => false),
|
|
62690
62861
|
audio: defaultOnError(boolean2().optional().default(false), () => false),
|
|
62691
62862
|
embeddedContext: defaultOnError(boolean2().optional().default(false), () => false),
|
|
62692
|
-
_meta: defaultOnError(
|
|
62863
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62693
62864
|
});
|
|
62694
62865
|
zMcpCapabilities = object({
|
|
62695
62866
|
http: defaultOnError(boolean2().optional().default(false), () => false),
|
|
62696
62867
|
sse: defaultOnError(boolean2().optional().default(false), () => false),
|
|
62697
62868
|
acp: defaultOnError(boolean2().optional().default(false), () => false),
|
|
62698
|
-
_meta: defaultOnError(
|
|
62869
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62699
62870
|
});
|
|
62700
62871
|
zSessionListCapabilities = object({
|
|
62701
|
-
_meta: defaultOnError(
|
|
62872
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62702
62873
|
});
|
|
62703
62874
|
zSessionDeleteCapabilities = object({
|
|
62704
|
-
_meta: defaultOnError(
|
|
62875
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62705
62876
|
});
|
|
62706
62877
|
zSessionAdditionalDirectoriesCapabilities = object({
|
|
62707
|
-
_meta: defaultOnError(
|
|
62878
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62708
62879
|
});
|
|
62709
62880
|
zSessionForkCapabilities = object({
|
|
62710
|
-
_meta: defaultOnError(
|
|
62881
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62711
62882
|
});
|
|
62712
62883
|
zSessionResumeCapabilities = object({
|
|
62713
|
-
_meta: defaultOnError(
|
|
62884
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62714
62885
|
});
|
|
62715
62886
|
zSessionCloseCapabilities = object({
|
|
62716
|
-
_meta: defaultOnError(
|
|
62887
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62717
62888
|
});
|
|
62718
62889
|
zSessionCapabilities = object({
|
|
62719
62890
|
list: defaultOnError(zSessionListCapabilities.nullish(), () => void 0),
|
|
@@ -62722,20 +62893,20 @@ var init_zod_gen = __esm({
|
|
|
62722
62893
|
fork: defaultOnError(zSessionForkCapabilities.nullish(), () => void 0),
|
|
62723
62894
|
resume: defaultOnError(zSessionResumeCapabilities.nullish(), () => void 0),
|
|
62724
62895
|
close: defaultOnError(zSessionCloseCapabilities.nullish(), () => void 0),
|
|
62725
|
-
_meta: defaultOnError(
|
|
62896
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62726
62897
|
});
|
|
62727
62898
|
zLogoutCapabilities = object({
|
|
62728
|
-
_meta: defaultOnError(
|
|
62899
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62729
62900
|
});
|
|
62730
62901
|
zAgentAuthCapabilities = object({
|
|
62731
62902
|
logout: defaultOnError(zLogoutCapabilities.nullish(), () => void 0),
|
|
62732
|
-
_meta: defaultOnError(
|
|
62903
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62733
62904
|
});
|
|
62734
62905
|
zProvidersCapabilities = object({
|
|
62735
|
-
_meta: defaultOnError(
|
|
62906
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62736
62907
|
});
|
|
62737
62908
|
zNesDocumentDidOpenCapabilities = object({
|
|
62738
|
-
_meta: defaultOnError(
|
|
62909
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62739
62910
|
});
|
|
62740
62911
|
zTextDocumentSyncKind = union([
|
|
62741
62912
|
literal("full"),
|
|
@@ -62743,16 +62914,16 @@ var init_zod_gen = __esm({
|
|
|
62743
62914
|
]);
|
|
62744
62915
|
zNesDocumentDidChangeCapabilities = object({
|
|
62745
62916
|
syncKind: zTextDocumentSyncKind,
|
|
62746
|
-
_meta: defaultOnError(
|
|
62917
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62747
62918
|
});
|
|
62748
62919
|
zNesDocumentDidCloseCapabilities = object({
|
|
62749
|
-
_meta: defaultOnError(
|
|
62920
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62750
62921
|
});
|
|
62751
62922
|
zNesDocumentDidSaveCapabilities = object({
|
|
62752
|
-
_meta: defaultOnError(
|
|
62923
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62753
62924
|
});
|
|
62754
62925
|
zNesDocumentDidFocusCapabilities = object({
|
|
62755
|
-
_meta: defaultOnError(
|
|
62926
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62756
62927
|
});
|
|
62757
62928
|
zNesDocumentEventCapabilities = object({
|
|
62758
62929
|
didOpen: defaultOnError(zNesDocumentDidOpenCapabilities.nullish(), () => void 0),
|
|
@@ -62760,38 +62931,38 @@ var init_zod_gen = __esm({
|
|
|
62760
62931
|
didClose: defaultOnError(zNesDocumentDidCloseCapabilities.nullish(), () => void 0),
|
|
62761
62932
|
didSave: defaultOnError(zNesDocumentDidSaveCapabilities.nullish(), () => void 0),
|
|
62762
62933
|
didFocus: defaultOnError(zNesDocumentDidFocusCapabilities.nullish(), () => void 0),
|
|
62763
|
-
_meta: defaultOnError(
|
|
62934
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62764
62935
|
});
|
|
62765
62936
|
zNesEventCapabilities = object({
|
|
62766
62937
|
document: defaultOnError(zNesDocumentEventCapabilities.nullish(), () => void 0),
|
|
62767
|
-
_meta: defaultOnError(
|
|
62938
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62768
62939
|
});
|
|
62769
62940
|
zNesRecentFilesCapabilities = object({
|
|
62770
62941
|
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
62771
62942
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
62772
62943
|
}).nullish(), () => void 0),
|
|
62773
|
-
_meta: defaultOnError(
|
|
62944
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62774
62945
|
});
|
|
62775
62946
|
zNesRelatedSnippetsCapabilities = object({
|
|
62776
|
-
_meta: defaultOnError(
|
|
62947
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62777
62948
|
});
|
|
62778
62949
|
zNesEditHistoryCapabilities = object({
|
|
62779
62950
|
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
62780
62951
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
62781
62952
|
}).nullish(), () => void 0),
|
|
62782
|
-
_meta: defaultOnError(
|
|
62953
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62783
62954
|
});
|
|
62784
62955
|
zNesUserActionsCapabilities = object({
|
|
62785
62956
|
maxCount: defaultOnError(int().gte(0).max(4294967295, {
|
|
62786
62957
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
62787
62958
|
}).nullish(), () => void 0),
|
|
62788
|
-
_meta: defaultOnError(
|
|
62959
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62789
62960
|
});
|
|
62790
62961
|
zNesOpenFilesCapabilities = object({
|
|
62791
|
-
_meta: defaultOnError(
|
|
62962
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62792
62963
|
});
|
|
62793
62964
|
zNesDiagnosticsCapabilities = object({
|
|
62794
|
-
_meta: defaultOnError(
|
|
62965
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62795
62966
|
});
|
|
62796
62967
|
zNesContextCapabilities = object({
|
|
62797
62968
|
recentFiles: defaultOnError(zNesRecentFilesCapabilities.nullish(), () => void 0),
|
|
@@ -62800,12 +62971,12 @@ var init_zod_gen = __esm({
|
|
|
62800
62971
|
userActions: defaultOnError(zNesUserActionsCapabilities.nullish(), () => void 0),
|
|
62801
62972
|
openFiles: defaultOnError(zNesOpenFilesCapabilities.nullish(), () => void 0),
|
|
62802
62973
|
diagnostics: defaultOnError(zNesDiagnosticsCapabilities.nullish(), () => void 0),
|
|
62803
|
-
_meta: defaultOnError(
|
|
62974
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62804
62975
|
});
|
|
62805
62976
|
zNesCapabilities = object({
|
|
62806
62977
|
events: defaultOnError(zNesEventCapabilities.nullish(), () => void 0),
|
|
62807
62978
|
context: defaultOnError(zNesContextCapabilities.nullish(), () => void 0),
|
|
62808
|
-
_meta: defaultOnError(
|
|
62979
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62809
62980
|
});
|
|
62810
62981
|
zPositionEncodingKind = union([
|
|
62811
62982
|
literal("utf-16"),
|
|
@@ -62837,7 +63008,7 @@ var init_zod_gen = __esm({
|
|
|
62837
63008
|
providers: defaultOnError(zProvidersCapabilities.nullish(), () => void 0),
|
|
62838
63009
|
nes: defaultOnError(zNesCapabilities.nullish(), () => void 0),
|
|
62839
63010
|
positionEncoding: defaultOnError(zPositionEncodingKind.nullish(), () => void 0),
|
|
62840
|
-
_meta: defaultOnError(
|
|
63011
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62841
63012
|
});
|
|
62842
63013
|
zAuthMethodId = string5();
|
|
62843
63014
|
zAuthMethodTerminal = object({
|
|
@@ -62845,14 +63016,14 @@ var init_zod_gen = __esm({
|
|
|
62845
63016
|
name: string5(),
|
|
62846
63017
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62847
63018
|
args: defaultOnError(vecSkipError(string5()).optional(), () => []),
|
|
62848
|
-
env: defaultOnError(
|
|
62849
|
-
_meta: defaultOnError(
|
|
63019
|
+
env: defaultOnError(record11(string5(), string5()).optional(), () => void 0),
|
|
63020
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62850
63021
|
});
|
|
62851
63022
|
zAuthMethodAgent = object({
|
|
62852
63023
|
id: zAuthMethodId,
|
|
62853
63024
|
name: string5(),
|
|
62854
63025
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62855
|
-
_meta: defaultOnError(
|
|
63026
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62856
63027
|
});
|
|
62857
63028
|
zAuthMethod = union([
|
|
62858
63029
|
zAuthMethodTerminal.and(object({
|
|
@@ -62864,7 +63035,7 @@ var init_zod_gen = __esm({
|
|
|
62864
63035
|
name: string5(),
|
|
62865
63036
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
62866
63037
|
version: string5(),
|
|
62867
|
-
_meta: defaultOnError(
|
|
63038
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62868
63039
|
});
|
|
62869
63040
|
zInitializeResponse = object({
|
|
62870
63041
|
protocolVersion: zProtocolVersion,
|
|
@@ -62899,10 +63070,10 @@ var init_zod_gen = __esm({
|
|
|
62899
63070
|
})),
|
|
62900
63071
|
authMethods: defaultOnError(vecSkipError(zAuthMethod).optional().default([]), () => []),
|
|
62901
63072
|
agentInfo: defaultOnError(zImplementation.nullish(), () => void 0),
|
|
62902
|
-
_meta: defaultOnError(
|
|
63073
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62903
63074
|
});
|
|
62904
63075
|
zAuthenticateResponse = object({
|
|
62905
|
-
_meta: defaultOnError(
|
|
63076
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62906
63077
|
});
|
|
62907
63078
|
zProviderId = string5();
|
|
62908
63079
|
zLlmProtocol = union([
|
|
@@ -62916,39 +63087,39 @@ var init_zod_gen = __esm({
|
|
|
62916
63087
|
zProviderCurrentConfig = object({
|
|
62917
63088
|
apiType: zLlmProtocol,
|
|
62918
63089
|
baseUrl: string5(),
|
|
62919
|
-
_meta: defaultOnError(
|
|
63090
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62920
63091
|
});
|
|
62921
63092
|
zProviderInfo = object({
|
|
62922
63093
|
providerId: zProviderId,
|
|
62923
63094
|
supported: requiredDefaultOnError(vecSkipError(zLlmProtocol), () => []),
|
|
62924
63095
|
required: boolean2(),
|
|
62925
63096
|
current: zProviderCurrentConfig.nullish(),
|
|
62926
|
-
_meta: defaultOnError(
|
|
63097
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62927
63098
|
});
|
|
62928
63099
|
zListProvidersResponse = object({
|
|
62929
63100
|
providers: array(zProviderInfo),
|
|
62930
|
-
_meta: defaultOnError(
|
|
63101
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62931
63102
|
});
|
|
62932
63103
|
zSetProviderResponse = object({
|
|
62933
|
-
_meta: defaultOnError(
|
|
63104
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62934
63105
|
});
|
|
62935
63106
|
zDisableProviderResponse = object({
|
|
62936
|
-
_meta: defaultOnError(
|
|
63107
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62937
63108
|
});
|
|
62938
63109
|
zLogoutResponse = object({
|
|
62939
|
-
_meta: defaultOnError(
|
|
63110
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62940
63111
|
});
|
|
62941
63112
|
zSessionModeId = string5();
|
|
62942
63113
|
zSessionMode = object({
|
|
62943
63114
|
id: zSessionModeId,
|
|
62944
63115
|
name: string5(),
|
|
62945
63116
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62946
|
-
_meta: defaultOnError(
|
|
63117
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62947
63118
|
});
|
|
62948
63119
|
zSessionModeState = object({
|
|
62949
63120
|
currentModeId: zSessionModeId,
|
|
62950
63121
|
availableModes: requiredDefaultOnError(vecSkipError(zSessionMode), () => []),
|
|
62951
|
-
_meta: defaultOnError(
|
|
63122
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62952
63123
|
});
|
|
62953
63124
|
zSessionConfigId = string5();
|
|
62954
63125
|
zSessionConfigOptionCategory = union([
|
|
@@ -62963,14 +63134,14 @@ var init_zod_gen = __esm({
|
|
|
62963
63134
|
value: zSessionConfigValueId,
|
|
62964
63135
|
name: string5(),
|
|
62965
63136
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62966
|
-
_meta: defaultOnError(
|
|
63137
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62967
63138
|
});
|
|
62968
63139
|
zSessionConfigGroupId = string5();
|
|
62969
63140
|
zSessionConfigSelectGroup = object({
|
|
62970
63141
|
group: zSessionConfigGroupId,
|
|
62971
63142
|
name: string5(),
|
|
62972
63143
|
options: requiredDefaultOnError(vecSkipError(zSessionConfigSelectOption), () => []),
|
|
62973
|
-
_meta: defaultOnError(
|
|
63144
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62974
63145
|
});
|
|
62975
63146
|
zSessionConfigSelectOptions = union([
|
|
62976
63147
|
array(zSessionConfigSelectOption),
|
|
@@ -62995,18 +63166,18 @@ var init_zod_gen = __esm({
|
|
|
62995
63166
|
name: string5(),
|
|
62996
63167
|
description: defaultOnError(string5().nullish(), () => void 0),
|
|
62997
63168
|
category: defaultOnError(zSessionConfigOptionCategory.nullish(), () => void 0),
|
|
62998
|
-
_meta: defaultOnError(
|
|
63169
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
62999
63170
|
}));
|
|
63000
63171
|
zNewSessionResponse = object({
|
|
63001
63172
|
sessionId: zSessionId,
|
|
63002
63173
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
63003
63174
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
63004
|
-
_meta: defaultOnError(
|
|
63175
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63005
63176
|
});
|
|
63006
63177
|
zLoadSessionResponse = object({
|
|
63007
63178
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
63008
63179
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
63009
|
-
_meta: defaultOnError(
|
|
63180
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63010
63181
|
});
|
|
63011
63182
|
zSessionInfo = object({
|
|
63012
63183
|
sessionId: zSessionId,
|
|
@@ -63014,36 +63185,36 @@ var init_zod_gen = __esm({
|
|
|
63014
63185
|
additionalDirectories: defaultOnError(vecSkipError(string5()).optional(), () => []),
|
|
63015
63186
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
63016
63187
|
updatedAt: defaultOnError(string5().nullish(), () => void 0),
|
|
63017
|
-
_meta: defaultOnError(
|
|
63188
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63018
63189
|
});
|
|
63019
63190
|
zListSessionsResponse = object({
|
|
63020
63191
|
sessions: requiredDefaultOnError(vecSkipError(zSessionInfo), () => []),
|
|
63021
63192
|
nextCursor: defaultOnError(string5().nullish(), () => void 0),
|
|
63022
|
-
_meta: defaultOnError(
|
|
63193
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63023
63194
|
});
|
|
63024
63195
|
zDeleteSessionResponse = object({
|
|
63025
|
-
_meta: defaultOnError(
|
|
63196
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63026
63197
|
});
|
|
63027
63198
|
zForkSessionResponse = object({
|
|
63028
63199
|
sessionId: zSessionId,
|
|
63029
63200
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
63030
63201
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
63031
|
-
_meta: defaultOnError(
|
|
63202
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63032
63203
|
});
|
|
63033
63204
|
zResumeSessionResponse = object({
|
|
63034
63205
|
modes: defaultOnError(zSessionModeState.nullish(), () => void 0),
|
|
63035
63206
|
configOptions: defaultOnError(vecSkipError(zSessionConfigOption).nullish(), () => void 0),
|
|
63036
|
-
_meta: defaultOnError(
|
|
63207
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63037
63208
|
});
|
|
63038
63209
|
zCloseSessionResponse = object({
|
|
63039
|
-
_meta: defaultOnError(
|
|
63210
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63040
63211
|
});
|
|
63041
63212
|
zSetSessionModeResponse = object({
|
|
63042
|
-
_meta: defaultOnError(
|
|
63213
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63043
63214
|
});
|
|
63044
63215
|
zSetSessionConfigOptionResponse = object({
|
|
63045
63216
|
configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
|
|
63046
|
-
_meta: defaultOnError(
|
|
63217
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63047
63218
|
});
|
|
63048
63219
|
zStopReason = union([
|
|
63049
63220
|
literal("end_turn"),
|
|
@@ -63059,16 +63230,16 @@ var init_zod_gen = __esm({
|
|
|
63059
63230
|
thoughtTokens: defaultOnError(number3().nullish(), () => void 0),
|
|
63060
63231
|
cachedReadTokens: defaultOnError(number3().nullish(), () => void 0),
|
|
63061
63232
|
cachedWriteTokens: defaultOnError(number3().nullish(), () => void 0),
|
|
63062
|
-
_meta: defaultOnError(
|
|
63233
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63063
63234
|
});
|
|
63064
63235
|
zPromptResponse = object({
|
|
63065
63236
|
stopReason: zStopReason,
|
|
63066
63237
|
usage: defaultOnError(zUsage.nullish(), () => void 0),
|
|
63067
|
-
_meta: defaultOnError(
|
|
63238
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63068
63239
|
});
|
|
63069
63240
|
zStartNesResponse = object({
|
|
63070
63241
|
sessionId: zSessionId,
|
|
63071
|
-
_meta: defaultOnError(
|
|
63242
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63072
63243
|
});
|
|
63073
63244
|
zNesSuggestionId = string5();
|
|
63074
63245
|
zPosition = object({
|
|
@@ -63078,37 +63249,37 @@ var init_zod_gen = __esm({
|
|
|
63078
63249
|
character: int().gte(0).max(4294967295, {
|
|
63079
63250
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
63080
63251
|
}),
|
|
63081
|
-
_meta: defaultOnError(
|
|
63252
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63082
63253
|
});
|
|
63083
63254
|
zRange = object({
|
|
63084
63255
|
start: zPosition,
|
|
63085
63256
|
end: zPosition,
|
|
63086
|
-
_meta: defaultOnError(
|
|
63257
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63087
63258
|
});
|
|
63088
63259
|
zNesTextEdit = object({
|
|
63089
63260
|
range: zRange,
|
|
63090
63261
|
newText: string5(),
|
|
63091
|
-
_meta: defaultOnError(
|
|
63262
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63092
63263
|
});
|
|
63093
63264
|
zNesEditSuggestion = object({
|
|
63094
63265
|
id: zNesSuggestionId,
|
|
63095
63266
|
uri: string5(),
|
|
63096
63267
|
edits: array(zNesTextEdit),
|
|
63097
63268
|
cursorPosition: defaultOnError(zPosition.nullish(), () => void 0),
|
|
63098
|
-
_meta: defaultOnError(
|
|
63269
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63099
63270
|
});
|
|
63100
63271
|
zNesJumpSuggestion = object({
|
|
63101
63272
|
id: zNesSuggestionId,
|
|
63102
63273
|
uri: string5(),
|
|
63103
63274
|
position: zPosition,
|
|
63104
|
-
_meta: defaultOnError(
|
|
63275
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63105
63276
|
});
|
|
63106
63277
|
zNesRenameSuggestion = object({
|
|
63107
63278
|
id: zNesSuggestionId,
|
|
63108
63279
|
uri: string5(),
|
|
63109
63280
|
position: zPosition,
|
|
63110
63281
|
newName: string5(),
|
|
63111
|
-
_meta: defaultOnError(
|
|
63282
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63112
63283
|
});
|
|
63113
63284
|
zNesSearchAndReplaceSuggestion = object({
|
|
63114
63285
|
id: zNesSuggestionId,
|
|
@@ -63116,7 +63287,7 @@ var init_zod_gen = __esm({
|
|
|
63116
63287
|
search: string5(),
|
|
63117
63288
|
replace: string5(),
|
|
63118
63289
|
isRegex: boolean2().nullish(),
|
|
63119
|
-
_meta: defaultOnError(
|
|
63290
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63120
63291
|
});
|
|
63121
63292
|
zNesSuggestion = union([
|
|
63122
63293
|
zNesEditSuggestion.and(object({
|
|
@@ -63134,10 +63305,10 @@ var init_zod_gen = __esm({
|
|
|
63134
63305
|
]);
|
|
63135
63306
|
zSuggestNesResponse = object({
|
|
63136
63307
|
suggestions: array(zNesSuggestion),
|
|
63137
|
-
_meta: defaultOnError(
|
|
63308
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63138
63309
|
});
|
|
63139
63310
|
zCloseNesResponse = object({
|
|
63140
|
-
_meta: defaultOnError(
|
|
63311
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63141
63312
|
});
|
|
63142
63313
|
zExtResponse = unknown();
|
|
63143
63314
|
zMessageMcpResponse = unknown();
|
|
@@ -63197,7 +63368,7 @@ var init_zod_gen = __esm({
|
|
|
63197
63368
|
zContentChunk = object({
|
|
63198
63369
|
content: zContentBlock,
|
|
63199
63370
|
messageId: defaultOnError(zMessageId.nullish(), () => void 0),
|
|
63200
|
-
_meta: defaultOnError(
|
|
63371
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63201
63372
|
});
|
|
63202
63373
|
zToolCall = object({
|
|
63203
63374
|
toolCallId: zToolCallId,
|
|
@@ -63209,7 +63380,7 @@ var init_zod_gen = __esm({
|
|
|
63209
63380
|
locations: defaultOnError(vecSkipError(zToolCallLocation).optional(), () => []),
|
|
63210
63381
|
rawInput: defaultOnError(unknown().optional(), () => void 0),
|
|
63211
63382
|
rawOutput: defaultOnError(unknown().optional(), () => void 0),
|
|
63212
|
-
_meta: defaultOnError(
|
|
63383
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63213
63384
|
});
|
|
63214
63385
|
zPlanEntryPriority = union([
|
|
63215
63386
|
literal("high"),
|
|
@@ -63225,27 +63396,27 @@ var init_zod_gen = __esm({
|
|
|
63225
63396
|
content: string5(),
|
|
63226
63397
|
priority: zPlanEntryPriority,
|
|
63227
63398
|
status: zPlanEntryStatus,
|
|
63228
|
-
_meta: defaultOnError(
|
|
63399
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63229
63400
|
});
|
|
63230
63401
|
zPlan = object({
|
|
63231
63402
|
entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),
|
|
63232
|
-
_meta: defaultOnError(
|
|
63403
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63233
63404
|
});
|
|
63234
63405
|
zPlanId = string5();
|
|
63235
63406
|
zPlanItems = object({
|
|
63236
63407
|
planId: zPlanId,
|
|
63237
63408
|
entries: requiredDefaultOnError(vecSkipError(zPlanEntry), () => []),
|
|
63238
|
-
_meta: defaultOnError(
|
|
63409
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63239
63410
|
});
|
|
63240
63411
|
zPlanFile = object({
|
|
63241
63412
|
planId: zPlanId,
|
|
63242
63413
|
uri: string5(),
|
|
63243
|
-
_meta: defaultOnError(
|
|
63414
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63244
63415
|
});
|
|
63245
63416
|
zPlanMarkdown = object({
|
|
63246
63417
|
planId: zPlanId,
|
|
63247
63418
|
content: string5(),
|
|
63248
|
-
_meta: defaultOnError(
|
|
63419
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63249
63420
|
});
|
|
63250
63421
|
zPlanUpdateContent = union([
|
|
63251
63422
|
zPlanItems.and(object({
|
|
@@ -63260,50 +63431,50 @@ var init_zod_gen = __esm({
|
|
|
63260
63431
|
]);
|
|
63261
63432
|
zPlanUpdate = object({
|
|
63262
63433
|
plan: zPlanUpdateContent,
|
|
63263
|
-
_meta: defaultOnError(
|
|
63434
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63264
63435
|
});
|
|
63265
63436
|
zPlanRemoved = object({
|
|
63266
63437
|
planId: zPlanId,
|
|
63267
|
-
_meta: defaultOnError(
|
|
63438
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63268
63439
|
});
|
|
63269
63440
|
zUnstructuredCommandInput = object({
|
|
63270
63441
|
hint: string5(),
|
|
63271
|
-
_meta: defaultOnError(
|
|
63442
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63272
63443
|
});
|
|
63273
63444
|
zAvailableCommandInput = zUnstructuredCommandInput;
|
|
63274
63445
|
zAvailableCommand = object({
|
|
63275
63446
|
name: string5(),
|
|
63276
63447
|
description: string5(),
|
|
63277
63448
|
input: defaultOnError(zAvailableCommandInput.nullish(), () => void 0),
|
|
63278
|
-
_meta: defaultOnError(
|
|
63449
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63279
63450
|
});
|
|
63280
63451
|
zAvailableCommandsUpdate = object({
|
|
63281
63452
|
availableCommands: requiredDefaultOnError(vecSkipError(zAvailableCommand), () => []),
|
|
63282
|
-
_meta: defaultOnError(
|
|
63453
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63283
63454
|
});
|
|
63284
63455
|
zCurrentModeUpdate = object({
|
|
63285
63456
|
currentModeId: zSessionModeId,
|
|
63286
|
-
_meta: defaultOnError(
|
|
63457
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63287
63458
|
});
|
|
63288
63459
|
zConfigOptionUpdate = object({
|
|
63289
63460
|
configOptions: requiredDefaultOnError(vecSkipError(zSessionConfigOption), () => []),
|
|
63290
|
-
_meta: defaultOnError(
|
|
63461
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63291
63462
|
});
|
|
63292
63463
|
zSessionInfoUpdate = object({
|
|
63293
63464
|
title: defaultOnError(string5().nullish(), () => void 0),
|
|
63294
63465
|
updatedAt: defaultOnError(string5().nullish(), () => void 0),
|
|
63295
|
-
_meta: defaultOnError(
|
|
63466
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63296
63467
|
});
|
|
63297
63468
|
zCost = object({
|
|
63298
63469
|
amount: number3(),
|
|
63299
63470
|
currency: string5(),
|
|
63300
|
-
_meta: defaultOnError(
|
|
63471
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63301
63472
|
});
|
|
63302
63473
|
zUsageUpdate = object({
|
|
63303
63474
|
used: number3(),
|
|
63304
63475
|
size: number3(),
|
|
63305
63476
|
cost: defaultOnError(zCost.nullish(), () => void 0),
|
|
63306
|
-
_meta: defaultOnError(
|
|
63477
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63307
63478
|
});
|
|
63308
63479
|
zCompactionId = string5();
|
|
63309
63480
|
zCompactionStatus = union([
|
|
@@ -63318,12 +63489,12 @@ var init_zod_gen = __esm({
|
|
|
63318
63489
|
status: zCompactionStatus,
|
|
63319
63490
|
summary: defaultOnError(vecSkipError(zContentBlock).nullish(), () => void 0),
|
|
63320
63491
|
error: defaultOnError(string5().nullish(), () => void 0),
|
|
63321
|
-
_meta: defaultOnError(
|
|
63492
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63322
63493
|
});
|
|
63323
63494
|
zCompactionSummaryChunk = object({
|
|
63324
63495
|
compactionId: zCompactionId,
|
|
63325
63496
|
content: zContentBlock,
|
|
63326
|
-
_meta: defaultOnError(
|
|
63497
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63327
63498
|
});
|
|
63328
63499
|
zSessionUpdate = union([
|
|
63329
63500
|
zContentChunk.and(object({
|
|
@@ -63375,17 +63546,17 @@ var init_zod_gen = __esm({
|
|
|
63375
63546
|
zSessionNotification = object({
|
|
63376
63547
|
sessionId: zSessionId,
|
|
63377
63548
|
update: zSessionUpdate,
|
|
63378
|
-
_meta: defaultOnError(
|
|
63549
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63379
63550
|
});
|
|
63380
63551
|
zCompleteElicitationNotification = object({
|
|
63381
63552
|
elicitationId: zElicitationId,
|
|
63382
|
-
_meta: defaultOnError(
|
|
63553
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63383
63554
|
});
|
|
63384
63555
|
zMessageMcpNotification = object({
|
|
63385
63556
|
connectionId: zMcpConnectionId,
|
|
63386
63557
|
method: string5(),
|
|
63387
|
-
params: defaultOnError(
|
|
63388
|
-
_meta: defaultOnError(
|
|
63558
|
+
params: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0),
|
|
63559
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63389
63560
|
});
|
|
63390
63561
|
zExtNotification = unknown();
|
|
63391
63562
|
zAgentNotification = object({
|
|
@@ -63400,53 +63571,53 @@ var init_zod_gen = __esm({
|
|
|
63400
63571
|
zFileSystemCapabilities = object({
|
|
63401
63572
|
readTextFile: defaultOnError(boolean2().optional().default(false), () => false),
|
|
63402
63573
|
writeTextFile: defaultOnError(boolean2().optional().default(false), () => false),
|
|
63403
|
-
_meta: defaultOnError(
|
|
63574
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63404
63575
|
});
|
|
63405
|
-
zCompactionCapabilities =
|
|
63576
|
+
zCompactionCapabilities = record11(string5(), unknown());
|
|
63406
63577
|
zBooleanConfigOptionCapabilities = object({
|
|
63407
|
-
_meta: defaultOnError(
|
|
63578
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63408
63579
|
});
|
|
63409
63580
|
zSessionConfigOptionsCapabilities = object({
|
|
63410
63581
|
boolean: defaultOnError(zBooleanConfigOptionCapabilities.nullish(), () => void 0),
|
|
63411
|
-
_meta: defaultOnError(
|
|
63582
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63412
63583
|
});
|
|
63413
63584
|
zClientSessionCapabilities = object({
|
|
63414
63585
|
compaction: defaultOnError(zCompactionCapabilities.nullish(), () => void 0),
|
|
63415
63586
|
configOptions: defaultOnError(zSessionConfigOptionsCapabilities.nullish(), () => void 0),
|
|
63416
|
-
_meta: defaultOnError(
|
|
63587
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63417
63588
|
});
|
|
63418
63589
|
zPlanCapabilities = object({
|
|
63419
|
-
_meta: defaultOnError(
|
|
63590
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63420
63591
|
});
|
|
63421
63592
|
zAuthCapabilities = object({
|
|
63422
63593
|
terminal: defaultOnError(boolean2().optional().default(false), () => false),
|
|
63423
|
-
_meta: defaultOnError(
|
|
63594
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63424
63595
|
});
|
|
63425
63596
|
zElicitationFormCapabilities = object({
|
|
63426
|
-
_meta: defaultOnError(
|
|
63597
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63427
63598
|
});
|
|
63428
63599
|
zElicitationUrlCapabilities = object({
|
|
63429
|
-
_meta: defaultOnError(
|
|
63600
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63430
63601
|
});
|
|
63431
63602
|
zElicitationCapabilities = object({
|
|
63432
63603
|
form: defaultOnError(zElicitationFormCapabilities.nullish(), () => void 0),
|
|
63433
63604
|
url: defaultOnError(zElicitationUrlCapabilities.nullish(), () => void 0),
|
|
63434
|
-
_meta: defaultOnError(
|
|
63605
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63435
63606
|
});
|
|
63436
63607
|
zNesJumpCapabilities = object({
|
|
63437
|
-
_meta: defaultOnError(
|
|
63608
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63438
63609
|
});
|
|
63439
63610
|
zNesRenameCapabilities = object({
|
|
63440
|
-
_meta: defaultOnError(
|
|
63611
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63441
63612
|
});
|
|
63442
63613
|
zNesSearchAndReplaceCapabilities = object({
|
|
63443
|
-
_meta: defaultOnError(
|
|
63614
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63444
63615
|
});
|
|
63445
63616
|
zClientNesCapabilities = object({
|
|
63446
63617
|
jump: defaultOnError(zNesJumpCapabilities.nullish(), () => void 0),
|
|
63447
63618
|
rename: defaultOnError(zNesRenameCapabilities.nullish(), () => void 0),
|
|
63448
63619
|
searchAndReplace: defaultOnError(zNesSearchAndReplaceCapabilities.nullish(), () => void 0),
|
|
63449
|
-
_meta: defaultOnError(
|
|
63620
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63450
63621
|
});
|
|
63451
63622
|
zClientCapabilities = object({
|
|
63452
63623
|
fs: defaultOnError(zFileSystemCapabilities.optional().default({ readTextFile: false, writeTextFile: false }), () => ({ readTextFile: false, writeTextFile: false })),
|
|
@@ -63457,7 +63628,7 @@ var init_zod_gen = __esm({
|
|
|
63457
63628
|
elicitation: defaultOnError(zElicitationCapabilities.nullish(), () => void 0),
|
|
63458
63629
|
nes: defaultOnError(zClientNesCapabilities.nullish(), () => void 0),
|
|
63459
63630
|
positionEncodings: defaultOnError(vecSkipError(zPositionEncodingKind).optional(), () => []),
|
|
63460
|
-
_meta: defaultOnError(
|
|
63631
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63461
63632
|
});
|
|
63462
63633
|
zInitializeRequest = object({
|
|
63463
63634
|
protocolVersion: zProtocolVersion,
|
|
@@ -63471,57 +63642,57 @@ var init_zod_gen = __esm({
|
|
|
63471
63642
|
auth: { terminal: false }
|
|
63472
63643
|
})),
|
|
63473
63644
|
clientInfo: defaultOnError(zImplementation.nullish(), () => void 0),
|
|
63474
|
-
_meta: defaultOnError(
|
|
63645
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63475
63646
|
});
|
|
63476
63647
|
zAuthenticateRequest = object({
|
|
63477
63648
|
methodId: zAuthMethodId,
|
|
63478
|
-
_meta: defaultOnError(
|
|
63649
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63479
63650
|
});
|
|
63480
63651
|
zListProvidersRequest = object({
|
|
63481
|
-
_meta: defaultOnError(
|
|
63652
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63482
63653
|
});
|
|
63483
63654
|
zSetProviderRequest = object({
|
|
63484
63655
|
providerId: zProviderId,
|
|
63485
63656
|
apiType: zLlmProtocol,
|
|
63486
63657
|
baseUrl: string5(),
|
|
63487
|
-
headers:
|
|
63488
|
-
_meta: defaultOnError(
|
|
63658
|
+
headers: record11(string5(), string5()).optional(),
|
|
63659
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63489
63660
|
});
|
|
63490
63661
|
zDisableProviderRequest = object({
|
|
63491
63662
|
providerId: zProviderId,
|
|
63492
|
-
_meta: defaultOnError(
|
|
63663
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63493
63664
|
});
|
|
63494
63665
|
zLogoutRequest = object({
|
|
63495
|
-
_meta: defaultOnError(
|
|
63666
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63496
63667
|
});
|
|
63497
63668
|
zHttpHeader = object({
|
|
63498
63669
|
name: string5(),
|
|
63499
63670
|
value: string5(),
|
|
63500
|
-
_meta: defaultOnError(
|
|
63671
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63501
63672
|
});
|
|
63502
63673
|
zMcpServerHttp = object({
|
|
63503
63674
|
name: string5(),
|
|
63504
63675
|
url: string5(),
|
|
63505
63676
|
headers: array(zHttpHeader),
|
|
63506
|
-
_meta: defaultOnError(
|
|
63677
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63507
63678
|
});
|
|
63508
63679
|
zMcpServerSse = object({
|
|
63509
63680
|
name: string5(),
|
|
63510
63681
|
url: string5(),
|
|
63511
63682
|
headers: array(zHttpHeader),
|
|
63512
|
-
_meta: defaultOnError(
|
|
63683
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63513
63684
|
});
|
|
63514
63685
|
zMcpServerAcp = object({
|
|
63515
63686
|
name: string5(),
|
|
63516
63687
|
serverId: zMcpServerAcpId,
|
|
63517
|
-
_meta: defaultOnError(
|
|
63688
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63518
63689
|
});
|
|
63519
63690
|
zMcpServerStdio = object({
|
|
63520
63691
|
name: string5(),
|
|
63521
63692
|
command: string5(),
|
|
63522
63693
|
args: array(string5()),
|
|
63523
63694
|
env: array(zEnvVariable),
|
|
63524
|
-
_meta: defaultOnError(
|
|
63695
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63525
63696
|
});
|
|
63526
63697
|
zMcpServer = union([
|
|
63527
63698
|
zMcpServerHttp.and(object({
|
|
@@ -63539,46 +63710,46 @@ var init_zod_gen = __esm({
|
|
|
63539
63710
|
cwd: string5(),
|
|
63540
63711
|
additionalDirectories: defaultOnError(vecSkipError(string5()).optional(), () => []),
|
|
63541
63712
|
mcpServers: requiredDefaultOnError(vecSkipError(zMcpServer), () => []),
|
|
63542
|
-
_meta: defaultOnError(
|
|
63713
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63543
63714
|
});
|
|
63544
63715
|
zLoadSessionRequest = object({
|
|
63545
63716
|
mcpServers: requiredDefaultOnError(vecSkipError(zMcpServer), () => []),
|
|
63546
63717
|
cwd: string5(),
|
|
63547
63718
|
additionalDirectories: defaultOnError(vecSkipError(string5()).optional(), () => []),
|
|
63548
63719
|
sessionId: zSessionId,
|
|
63549
|
-
_meta: defaultOnError(
|
|
63720
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63550
63721
|
});
|
|
63551
63722
|
zListSessionsRequest = object({
|
|
63552
63723
|
cwd: string5().nullish(),
|
|
63553
63724
|
cursor: string5().nullish(),
|
|
63554
|
-
_meta: defaultOnError(
|
|
63725
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63555
63726
|
});
|
|
63556
63727
|
zDeleteSessionRequest = object({
|
|
63557
63728
|
sessionId: zSessionId,
|
|
63558
|
-
_meta: defaultOnError(
|
|
63729
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63559
63730
|
});
|
|
63560
63731
|
zForkSessionRequest = object({
|
|
63561
63732
|
sessionId: zSessionId,
|
|
63562
63733
|
cwd: string5(),
|
|
63563
63734
|
additionalDirectories: defaultOnError(vecSkipError(string5()).optional(), () => []),
|
|
63564
63735
|
mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
|
|
63565
|
-
_meta: defaultOnError(
|
|
63736
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63566
63737
|
});
|
|
63567
63738
|
zResumeSessionRequest = object({
|
|
63568
63739
|
sessionId: zSessionId,
|
|
63569
63740
|
cwd: string5(),
|
|
63570
63741
|
additionalDirectories: defaultOnError(vecSkipError(string5()).optional(), () => []),
|
|
63571
63742
|
mcpServers: defaultOnError(vecSkipError(zMcpServer).optional(), () => []),
|
|
63572
|
-
_meta: defaultOnError(
|
|
63743
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63573
63744
|
});
|
|
63574
63745
|
zCloseSessionRequest = object({
|
|
63575
63746
|
sessionId: zSessionId,
|
|
63576
|
-
_meta: defaultOnError(
|
|
63747
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63577
63748
|
});
|
|
63578
63749
|
zSetSessionModeRequest = object({
|
|
63579
63750
|
sessionId: zSessionId,
|
|
63580
63751
|
modeId: zSessionModeId,
|
|
63581
|
-
_meta: defaultOnError(
|
|
63752
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63582
63753
|
});
|
|
63583
63754
|
zSetSessionConfigOptionRequest = intersection(union([
|
|
63584
63755
|
object({
|
|
@@ -63591,29 +63762,29 @@ var init_zod_gen = __esm({
|
|
|
63591
63762
|
]), object({
|
|
63592
63763
|
sessionId: zSessionId,
|
|
63593
63764
|
configId: zSessionConfigId,
|
|
63594
|
-
_meta: defaultOnError(
|
|
63765
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63595
63766
|
}));
|
|
63596
63767
|
zPromptRequest = object({
|
|
63597
63768
|
sessionId: zSessionId,
|
|
63598
63769
|
prompt: array(zContentBlock),
|
|
63599
|
-
_meta: defaultOnError(
|
|
63770
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63600
63771
|
});
|
|
63601
63772
|
zWorkspaceFolder = object({
|
|
63602
63773
|
uri: string5(),
|
|
63603
63774
|
name: string5(),
|
|
63604
|
-
_meta: defaultOnError(
|
|
63775
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63605
63776
|
});
|
|
63606
63777
|
zNesRepository = object({
|
|
63607
63778
|
name: string5(),
|
|
63608
63779
|
owner: string5(),
|
|
63609
63780
|
remoteUrl: string5(),
|
|
63610
|
-
_meta: defaultOnError(
|
|
63781
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63611
63782
|
});
|
|
63612
63783
|
zStartNesRequest = object({
|
|
63613
63784
|
workspaceUri: defaultOnError(string5().nullish(), () => void 0),
|
|
63614
63785
|
workspaceFolders: array(zWorkspaceFolder).nullish(),
|
|
63615
63786
|
repository: defaultOnError(zNesRepository.nullish(), () => void 0),
|
|
63616
|
-
_meta: defaultOnError(
|
|
63787
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63617
63788
|
});
|
|
63618
63789
|
zNesTriggerKind = union([
|
|
63619
63790
|
literal("automatic"),
|
|
@@ -63624,7 +63795,7 @@ var init_zod_gen = __esm({
|
|
|
63624
63795
|
uri: string5(),
|
|
63625
63796
|
languageId: string5(),
|
|
63626
63797
|
text: string5(),
|
|
63627
|
-
_meta: defaultOnError(
|
|
63798
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63628
63799
|
});
|
|
63629
63800
|
zNesExcerpt = object({
|
|
63630
63801
|
startLine: int().gte(0).max(4294967295, {
|
|
@@ -63634,31 +63805,31 @@ var init_zod_gen = __esm({
|
|
|
63634
63805
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
63635
63806
|
}),
|
|
63636
63807
|
text: string5(),
|
|
63637
|
-
_meta: defaultOnError(
|
|
63808
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63638
63809
|
});
|
|
63639
63810
|
zNesRelatedSnippet = object({
|
|
63640
63811
|
uri: string5(),
|
|
63641
63812
|
excerpts: array(zNesExcerpt),
|
|
63642
|
-
_meta: defaultOnError(
|
|
63813
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63643
63814
|
});
|
|
63644
63815
|
zNesEditHistoryEntry = object({
|
|
63645
63816
|
uri: string5(),
|
|
63646
63817
|
diff: string5(),
|
|
63647
|
-
_meta: defaultOnError(
|
|
63818
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63648
63819
|
});
|
|
63649
63820
|
zNesUserAction = object({
|
|
63650
63821
|
action: string5(),
|
|
63651
63822
|
uri: string5(),
|
|
63652
63823
|
position: zPosition,
|
|
63653
63824
|
timestampMs: number3(),
|
|
63654
|
-
_meta: defaultOnError(
|
|
63825
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63655
63826
|
});
|
|
63656
63827
|
zNesOpenFile = object({
|
|
63657
63828
|
uri: string5(),
|
|
63658
63829
|
languageId: string5(),
|
|
63659
63830
|
visibleRange: defaultOnError(zRange.nullish(), () => void 0),
|
|
63660
63831
|
lastFocusedMs: defaultOnError(number3().nullish(), () => void 0),
|
|
63661
|
-
_meta: defaultOnError(
|
|
63832
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63662
63833
|
});
|
|
63663
63834
|
zNesDiagnosticSeverity = union([
|
|
63664
63835
|
literal("error"),
|
|
@@ -63671,7 +63842,7 @@ var init_zod_gen = __esm({
|
|
|
63671
63842
|
range: zRange,
|
|
63672
63843
|
severity: zNesDiagnosticSeverity,
|
|
63673
63844
|
message: string5(),
|
|
63674
|
-
_meta: defaultOnError(
|
|
63845
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63675
63846
|
});
|
|
63676
63847
|
zNesSuggestContext = object({
|
|
63677
63848
|
recentFiles: array(zNesRecentFile).nullish(),
|
|
@@ -63680,7 +63851,7 @@ var init_zod_gen = __esm({
|
|
|
63680
63851
|
userActions: array(zNesUserAction).nullish(),
|
|
63681
63852
|
openFiles: array(zNesOpenFile).nullish(),
|
|
63682
63853
|
diagnostics: array(zNesDiagnostic).nullish(),
|
|
63683
|
-
_meta: defaultOnError(
|
|
63854
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63684
63855
|
});
|
|
63685
63856
|
zSuggestNesRequest = object({
|
|
63686
63857
|
sessionId: zSessionId,
|
|
@@ -63690,11 +63861,11 @@ var init_zod_gen = __esm({
|
|
|
63690
63861
|
selection: zRange.nullish(),
|
|
63691
63862
|
triggerKind: zNesTriggerKind,
|
|
63692
63863
|
context: zNesSuggestContext.nullish(),
|
|
63693
|
-
_meta: defaultOnError(
|
|
63864
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63694
63865
|
});
|
|
63695
63866
|
zCloseNesRequest = object({
|
|
63696
63867
|
sessionId: zSessionId,
|
|
63697
|
-
_meta: defaultOnError(
|
|
63868
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63698
63869
|
});
|
|
63699
63870
|
zClientRequest = object({
|
|
63700
63871
|
id: zRequestId,
|
|
@@ -63724,15 +63895,15 @@ var init_zod_gen = __esm({
|
|
|
63724
63895
|
]).nullish()
|
|
63725
63896
|
});
|
|
63726
63897
|
zWriteTextFileResponse = object({
|
|
63727
|
-
_meta: defaultOnError(
|
|
63898
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63728
63899
|
});
|
|
63729
63900
|
zReadTextFileResponse = object({
|
|
63730
63901
|
content: string5(),
|
|
63731
|
-
_meta: defaultOnError(
|
|
63902
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63732
63903
|
});
|
|
63733
63904
|
zSelectedPermissionOutcome = object({
|
|
63734
63905
|
optionId: zPermissionOptionId,
|
|
63735
|
-
_meta: defaultOnError(
|
|
63906
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63736
63907
|
});
|
|
63737
63908
|
zRequestPermissionOutcome = union([
|
|
63738
63909
|
object({
|
|
@@ -63744,37 +63915,37 @@ var init_zod_gen = __esm({
|
|
|
63744
63915
|
]);
|
|
63745
63916
|
zRequestPermissionResponse = object({
|
|
63746
63917
|
outcome: zRequestPermissionOutcome,
|
|
63747
|
-
_meta: defaultOnError(
|
|
63918
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63748
63919
|
});
|
|
63749
63920
|
zCreateTerminalResponse = object({
|
|
63750
63921
|
terminalId: zTerminalId,
|
|
63751
|
-
_meta: defaultOnError(
|
|
63922
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63752
63923
|
});
|
|
63753
63924
|
zTerminalExitStatus = object({
|
|
63754
63925
|
exitCode: defaultOnError(int().gte(0).max(4294967295, {
|
|
63755
63926
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
63756
63927
|
}).nullish(), () => void 0),
|
|
63757
63928
|
signal: defaultOnError(string5().nullish(), () => void 0),
|
|
63758
|
-
_meta: defaultOnError(
|
|
63929
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63759
63930
|
});
|
|
63760
63931
|
zTerminalOutputResponse = object({
|
|
63761
63932
|
output: string5(),
|
|
63762
63933
|
truncated: boolean2(),
|
|
63763
63934
|
exitStatus: defaultOnError(zTerminalExitStatus.nullish(), () => void 0),
|
|
63764
|
-
_meta: defaultOnError(
|
|
63935
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63765
63936
|
});
|
|
63766
63937
|
zReleaseTerminalResponse = object({
|
|
63767
|
-
_meta: defaultOnError(
|
|
63938
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63768
63939
|
});
|
|
63769
63940
|
zWaitForTerminalExitResponse = object({
|
|
63770
63941
|
exitCode: defaultOnError(int().gte(0).max(4294967295, {
|
|
63771
63942
|
error: "Invalid value: Expected uint32 to be <= 4294967295"
|
|
63772
63943
|
}).nullish(), () => void 0),
|
|
63773
63944
|
signal: defaultOnError(string5().nullish(), () => void 0),
|
|
63774
|
-
_meta: defaultOnError(
|
|
63945
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63775
63946
|
});
|
|
63776
63947
|
zKillTerminalResponse = object({
|
|
63777
|
-
_meta: defaultOnError(
|
|
63948
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63778
63949
|
});
|
|
63779
63950
|
zElicitationContentValue = union([
|
|
63780
63951
|
string5(),
|
|
@@ -63784,7 +63955,7 @@ var init_zod_gen = __esm({
|
|
|
63784
63955
|
array(string5())
|
|
63785
63956
|
]);
|
|
63786
63957
|
zElicitationAcceptAction = object({
|
|
63787
|
-
content:
|
|
63958
|
+
content: record11(string5(), zElicitationContentValue).nullish()
|
|
63788
63959
|
});
|
|
63789
63960
|
zCreateElicitationResponse = preserveCustomPayload(intersection(union([
|
|
63790
63961
|
zElicitationAcceptAction.and(object({
|
|
@@ -63800,14 +63971,14 @@ var init_zod_gen = __esm({
|
|
|
63800
63971
|
action: string5()
|
|
63801
63972
|
}), "action", ["accept", "cancel", "decline"])
|
|
63802
63973
|
]), object({
|
|
63803
|
-
_meta: defaultOnError(
|
|
63974
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63804
63975
|
})), "action", ["accept", "cancel", "decline"]);
|
|
63805
63976
|
zConnectMcpResponse = object({
|
|
63806
63977
|
connectionId: zMcpConnectionId,
|
|
63807
|
-
_meta: defaultOnError(
|
|
63978
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63808
63979
|
});
|
|
63809
63980
|
zDisconnectMcpResponse = object({
|
|
63810
|
-
_meta: defaultOnError(
|
|
63981
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63811
63982
|
});
|
|
63812
63983
|
zClientResponse = union([
|
|
63813
63984
|
object({
|
|
@@ -63835,7 +64006,7 @@ var init_zod_gen = __esm({
|
|
|
63835
64006
|
]);
|
|
63836
64007
|
zCancelNotification = object({
|
|
63837
64008
|
sessionId: zSessionId,
|
|
63838
|
-
_meta: defaultOnError(
|
|
64009
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63839
64010
|
});
|
|
63840
64011
|
zDidOpenDocumentNotification = object({
|
|
63841
64012
|
sessionId: zSessionId,
|
|
@@ -63843,29 +64014,29 @@ var init_zod_gen = __esm({
|
|
|
63843
64014
|
languageId: string5(),
|
|
63844
64015
|
version: number3(),
|
|
63845
64016
|
text: string5(),
|
|
63846
|
-
_meta: defaultOnError(
|
|
64017
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63847
64018
|
});
|
|
63848
64019
|
zTextDocumentContentChangeEvent = object({
|
|
63849
64020
|
range: zRange.nullish(),
|
|
63850
64021
|
text: string5(),
|
|
63851
|
-
_meta: defaultOnError(
|
|
64022
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63852
64023
|
});
|
|
63853
64024
|
zDidChangeDocumentNotification = object({
|
|
63854
64025
|
sessionId: zSessionId,
|
|
63855
64026
|
uri: string5(),
|
|
63856
64027
|
version: number3(),
|
|
63857
64028
|
contentChanges: requiredDefaultOnError(vecSkipError(zTextDocumentContentChangeEvent), () => []),
|
|
63858
|
-
_meta: defaultOnError(
|
|
64029
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63859
64030
|
});
|
|
63860
64031
|
zDidCloseDocumentNotification = object({
|
|
63861
64032
|
sessionId: zSessionId,
|
|
63862
64033
|
uri: string5(),
|
|
63863
|
-
_meta: defaultOnError(
|
|
64034
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63864
64035
|
});
|
|
63865
64036
|
zDidSaveDocumentNotification = object({
|
|
63866
64037
|
sessionId: zSessionId,
|
|
63867
64038
|
uri: string5(),
|
|
63868
|
-
_meta: defaultOnError(
|
|
64039
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63869
64040
|
});
|
|
63870
64041
|
zDidFocusDocumentNotification = object({
|
|
63871
64042
|
sessionId: zSessionId,
|
|
@@ -63873,12 +64044,12 @@ var init_zod_gen = __esm({
|
|
|
63873
64044
|
version: number3(),
|
|
63874
64045
|
position: zPosition,
|
|
63875
64046
|
visibleRange: zRange,
|
|
63876
|
-
_meta: defaultOnError(
|
|
64047
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63877
64048
|
});
|
|
63878
64049
|
zAcceptNesNotification = object({
|
|
63879
64050
|
sessionId: zSessionId,
|
|
63880
64051
|
id: zNesSuggestionId,
|
|
63881
|
-
_meta: defaultOnError(
|
|
64052
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63882
64053
|
});
|
|
63883
64054
|
zNesRejectReason = union([
|
|
63884
64055
|
literal("rejected"),
|
|
@@ -63890,7 +64061,7 @@ var init_zod_gen = __esm({
|
|
|
63890
64061
|
sessionId: zSessionId,
|
|
63891
64062
|
id: zNesSuggestionId,
|
|
63892
64063
|
reason: defaultOnError(zNesRejectReason.nullish(), () => void 0),
|
|
63893
|
-
_meta: defaultOnError(
|
|
64064
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63894
64065
|
});
|
|
63895
64066
|
zClientNotification = object({
|
|
63896
64067
|
method: string5(),
|
|
@@ -63909,7 +64080,7 @@ var init_zod_gen = __esm({
|
|
|
63909
64080
|
});
|
|
63910
64081
|
zCancelRequestNotification = object({
|
|
63911
64082
|
requestId: zRequestId,
|
|
63912
|
-
_meta: defaultOnError(
|
|
64083
|
+
_meta: defaultOnError(record11(string5(), unknown()).nullish(), () => void 0)
|
|
63913
64084
|
});
|
|
63914
64085
|
}
|
|
63915
64086
|
});
|
|
@@ -68800,9 +68971,9 @@ function formatGrokAskUserAccepted(answers) {
|
|
|
68800
68971
|
if (!answers || typeof answers !== "object" || Array.isArray(answers)) {
|
|
68801
68972
|
return formatGrokAskUserCancelled();
|
|
68802
68973
|
}
|
|
68803
|
-
const
|
|
68804
|
-
const wrapped =
|
|
68805
|
-
const source = wrapped ?
|
|
68974
|
+
const record12 = answers;
|
|
68975
|
+
const wrapped = record12.answers !== null && typeof record12.answers === "object" && !Array.isArray(record12.answers);
|
|
68976
|
+
const source = wrapped ? record12.answers : record12;
|
|
68806
68977
|
const normalized = {};
|
|
68807
68978
|
for (const [question, value] of Object.entries(source)) {
|
|
68808
68979
|
if (typeof value === "string") {
|
|
@@ -68817,7 +68988,7 @@ function formatGrokAskUserAccepted(answers) {
|
|
|
68817
68988
|
return {
|
|
68818
68989
|
outcome: "accepted",
|
|
68819
68990
|
answers: normalized,
|
|
68820
|
-
...wrapped &&
|
|
68991
|
+
...wrapped && record12.annotations && typeof record12.annotations === "object" && !Array.isArray(record12.annotations) ? { annotations: record12.annotations } : {}
|
|
68821
68992
|
};
|
|
68822
68993
|
}
|
|
68823
68994
|
function formatGrokExitPlanCancelled(feedback) {
|
|
@@ -79597,9 +79768,9 @@ var init_codex_admin_service = __esm({
|
|
|
79597
79768
|
async installPlugin(projectId, key, apiProviderId) {
|
|
79598
79769
|
return this.withClient(projectId, apiProviderId, async (client3, path) => {
|
|
79599
79770
|
const records2 = await listPluginInventory(client3, path);
|
|
79600
|
-
const
|
|
79601
|
-
if (!
|
|
79602
|
-
await installPlugin2(client3,
|
|
79771
|
+
const record12 = records2.find((r) => r.key === key);
|
|
79772
|
+
if (!record12) throw new Error(`Unknown Codex plugin: ${key}`);
|
|
79773
|
+
await installPlugin2(client3, record12.marketplacePath, record12.name);
|
|
79603
79774
|
return { ok: true, key };
|
|
79604
79775
|
});
|
|
79605
79776
|
}
|
|
@@ -89570,6 +89741,8 @@ var SUPERONE_TOOL_SUMMARY_FIELDS = {
|
|
|
89570
89741
|
composer_request: ["title"],
|
|
89571
89742
|
config_read: ["domain"],
|
|
89572
89743
|
read_manual: ["domain", "topic"],
|
|
89744
|
+
// The card, never the brief: the phone cannot launch it.
|
|
89745
|
+
session_suggest_task: ["title", "tldr"],
|
|
89573
89746
|
miniapp_dev_register: ["name", "directory", "appDir"],
|
|
89574
89747
|
miniapp_dev_update_types: ["appDir"],
|
|
89575
89748
|
miniapp_dev_setup: ["name", "directory", "description"],
|
|
@@ -91845,6 +92018,126 @@ function handleAuthRequest(path, body, bearer, opts) {
|
|
|
91845
92018
|
}
|
|
91846
92019
|
}
|
|
91847
92020
|
|
|
92021
|
+
// ../../packages/runtime/src/server/rpc-session-operations.ts
|
|
92022
|
+
init_environment();
|
|
92023
|
+
|
|
92024
|
+
// ../../packages/shared/src/environment/session-operations.ts
|
|
92025
|
+
var SESSION_OPERATION_METHODS = /* @__PURE__ */ new Set([
|
|
92026
|
+
"session.reportWorktreeRemoved",
|
|
92027
|
+
"session.forceRecover",
|
|
92028
|
+
"session.scheduledSend.get",
|
|
92029
|
+
"session.scheduledSend.set",
|
|
92030
|
+
"session.scheduledSend.clear",
|
|
92031
|
+
"session.sideChatStart",
|
|
92032
|
+
"session.sideChatClose",
|
|
92033
|
+
"session.contextUsage",
|
|
92034
|
+
"session.mcpStatus",
|
|
92035
|
+
"session.mcpAuthenticate",
|
|
92036
|
+
"session.stopTask",
|
|
92037
|
+
"session.startQueued",
|
|
92038
|
+
"session.reset",
|
|
92039
|
+
"session.rewind",
|
|
92040
|
+
"session.previewRewind",
|
|
92041
|
+
"session.truncateAtCheckpoint"
|
|
92042
|
+
]);
|
|
92043
|
+
var SESSION_OPERATION_READS = /* @__PURE__ */ new Set(["session.scheduledSend.get", "session.previewRewind", "session.contextUsage", "session.mcpStatus"]);
|
|
92044
|
+
var SESSION_LIST_OPERATION_METHODS = /* @__PURE__ */ new Set(["sessionList.scheduledSends", "sessionList.deleteOlderThan"]);
|
|
92045
|
+
|
|
92046
|
+
// ../../packages/runtime/src/server/rpc-helpers.ts
|
|
92047
|
+
init_environment();
|
|
92048
|
+
function requireScopes(client3, scopes) {
|
|
92049
|
+
if (!hasAllScopes(client3.scopes, scopes)) {
|
|
92050
|
+
return { error: { code: "forbidden", message: `missing scopes: ${scopes.join(", ")}` } };
|
|
92051
|
+
}
|
|
92052
|
+
return null;
|
|
92053
|
+
}
|
|
92054
|
+
function asRecord(payload) {
|
|
92055
|
+
return payload && typeof payload === "object" ? payload : {};
|
|
92056
|
+
}
|
|
92057
|
+
function mapThrown(err) {
|
|
92058
|
+
const e = err;
|
|
92059
|
+
const code = e.code ?? "internal";
|
|
92060
|
+
return {
|
|
92061
|
+
error: { code, message: e.message || "internal error", ...e.details ? { details: e.details } : {} }
|
|
92062
|
+
};
|
|
92063
|
+
}
|
|
92064
|
+
function optionalString(value) {
|
|
92065
|
+
return typeof value === "string" && value.length > 0 ? value : null;
|
|
92066
|
+
}
|
|
92067
|
+
|
|
92068
|
+
// ../../packages/runtime/src/server/rpc-session-operations.ts
|
|
92069
|
+
function requiredText(input, field) {
|
|
92070
|
+
const value = input[field];
|
|
92071
|
+
if (typeof value !== "string" || !value.trim()) throw Object.assign(new Error(`${field} required`), { code: "invalid_argument" });
|
|
92072
|
+
return value;
|
|
92073
|
+
}
|
|
92074
|
+
async function callOperation(payload, ctx, method) {
|
|
92075
|
+
const denied = requireScopes(ctx.client, SESSION_OPERATION_READS.has(method) ? OPERATION_SCOPES.readSession : OPERATION_SCOPES.operateSession);
|
|
92076
|
+
if (denied) return denied;
|
|
92077
|
+
const p3 = asRecord(payload);
|
|
92078
|
+
try {
|
|
92079
|
+
const sessionId = requiredText(p3, "sessionId");
|
|
92080
|
+
if (method === "session.rewind" || method === "session.previewRewind" || method === "session.truncateAtCheckpoint") requiredText(p3, "checkpointId");
|
|
92081
|
+
if (method === "session.mcpAuthenticate") requiredText(p3, "serverName");
|
|
92082
|
+
if (method === "session.stopTask") requiredText(p3, "taskId");
|
|
92083
|
+
if (method === "session.forceRecover" && p3.message !== void 0 && typeof p3.message !== "string") throw Object.assign(new Error("message must be a string"), { code: "invalid_argument" });
|
|
92084
|
+
if (method === "session.scheduledSend.set") {
|
|
92085
|
+
const patch = asRecord(p3.patch);
|
|
92086
|
+
if (p3.patch === null || typeof p3.patch !== "object" || Array.isArray(p3.patch) || patch.sendAt !== void 0 && (typeof patch.sendAt !== "number" || !Number.isFinite(patch.sendAt)) || patch.message !== void 0 && patch.message !== null && typeof patch.message !== "string" || patch.armed !== void 0 && typeof patch.armed !== "boolean" || patch.attachments !== void 0 && patch.attachments !== null && !Array.isArray(patch.attachments) || patch.source !== void 0 && !["manual", "rate_limit"].includes(String(patch.source))) {
|
|
92087
|
+
throw Object.assign(new Error("invalid scheduled send patch"), { code: "invalid_argument" });
|
|
92088
|
+
}
|
|
92089
|
+
}
|
|
92090
|
+
if (method === "session.reset" && p3.newSessionId !== void 0) {
|
|
92091
|
+
requiredText(p3, "newSessionId");
|
|
92092
|
+
if (p3.newSessionId === sessionId) throw Object.assign(new Error("reset needs a new session id"), { code: "invalid_argument" });
|
|
92093
|
+
}
|
|
92094
|
+
if (method === "session.rewind" && !["files", "conversation", "code+chat"].includes(String(p3.mode))) {
|
|
92095
|
+
throw Object.assign(new Error("invalid rewind mode"), { code: "invalid_argument" });
|
|
92096
|
+
}
|
|
92097
|
+
if (!ctx.sessions?.get(sessionId)) throw Object.assign(new Error("session not found"), { code: "not_found" });
|
|
92098
|
+
if (!SESSION_OPERATION_READS.has(method)) {
|
|
92099
|
+
ctx.leases.assertValid({
|
|
92100
|
+
resource: { environmentId: ctx.identity.environmentId, sessionId },
|
|
92101
|
+
leaseId: requiredText(p3, "leaseId"),
|
|
92102
|
+
generation: requiredText(p3, "generation"),
|
|
92103
|
+
holderClientId: ctx.client.clientSessionId
|
|
92104
|
+
});
|
|
92105
|
+
}
|
|
92106
|
+
const result2 = await ctx.sessions.callOperation(sessionId, method, p3);
|
|
92107
|
+
return { result: result2 ?? null };
|
|
92108
|
+
} catch (error51) {
|
|
92109
|
+
return mapThrown(error51);
|
|
92110
|
+
}
|
|
92111
|
+
}
|
|
92112
|
+
async function callListOperation(payload, ctx, method) {
|
|
92113
|
+
const denied = requireScopes(ctx.client, method === "sessionList.deleteOlderThan" ? OPERATION_SCOPES.operateSession : OPERATION_SCOPES.readSession);
|
|
92114
|
+
if (denied) return denied;
|
|
92115
|
+
const p3 = asRecord(payload);
|
|
92116
|
+
try {
|
|
92117
|
+
if (method === "sessionList.deleteOlderThan") {
|
|
92118
|
+
requiredText(p3, "projectId");
|
|
92119
|
+
if (!Number.isFinite(Date.parse(requiredText(p3, "cutoffDate")))) throw Object.assign(new Error("invalid cutoff date"), { code: "invalid_argument" });
|
|
92120
|
+
if (!Array.isArray(p3.controls)) throw Object.assign(new Error("session controls required"), { code: "invalid_argument" });
|
|
92121
|
+
for (const input of p3.controls) {
|
|
92122
|
+
const control = asRecord(input);
|
|
92123
|
+
ctx.leases.assertValid({
|
|
92124
|
+
resource: { environmentId: ctx.identity.environmentId, sessionId: requiredText(control, "sessionId") },
|
|
92125
|
+
leaseId: requiredText(control, "leaseId"),
|
|
92126
|
+
generation: requiredText(control, "generation"),
|
|
92127
|
+
holderClientId: ctx.client.clientSessionId
|
|
92128
|
+
});
|
|
92129
|
+
}
|
|
92130
|
+
}
|
|
92131
|
+
return { result: await ctx.sessions.callListOperation(method, p3, ctx.client.clientSessionId) };
|
|
92132
|
+
} catch (error51) {
|
|
92133
|
+
return mapThrown(error51);
|
|
92134
|
+
}
|
|
92135
|
+
}
|
|
92136
|
+
var SESSION_OPERATION_HANDLERS = Object.fromEntries([
|
|
92137
|
+
...[...SESSION_OPERATION_METHODS].map((method) => [method, callOperation]),
|
|
92138
|
+
...[...SESSION_LIST_OPERATION_METHODS].map((method) => [method, callListOperation])
|
|
92139
|
+
]);
|
|
92140
|
+
|
|
91848
92141
|
// ../../packages/runtime/src/server/rpc-dispatch.ts
|
|
91849
92142
|
import { dirname as configDirname, join as pathJoin, resolve as pathResolve2, sep as sep4 } from "node:path";
|
|
91850
92143
|
|
|
@@ -92032,31 +92325,9 @@ function resolveAgentTurnDefaults(settings, harnessId) {
|
|
|
92032
92325
|
// ../../packages/runtime/src/server/rpc-session-create.ts
|
|
92033
92326
|
init_session();
|
|
92034
92327
|
|
|
92035
|
-
// ../../packages/runtime/src/server/rpc-helpers.ts
|
|
92036
|
-
init_environment();
|
|
92037
|
-
function requireScopes(client3, scopes) {
|
|
92038
|
-
if (!hasAllScopes(client3.scopes, scopes)) {
|
|
92039
|
-
return { error: { code: "forbidden", message: `missing scopes: ${scopes.join(", ")}` } };
|
|
92040
|
-
}
|
|
92041
|
-
return null;
|
|
92042
|
-
}
|
|
92043
|
-
function asRecord3(payload) {
|
|
92044
|
-
return payload && typeof payload === "object" ? payload : {};
|
|
92045
|
-
}
|
|
92046
|
-
function mapThrown(err) {
|
|
92047
|
-
const e = err;
|
|
92048
|
-
const code = e.code ?? "internal";
|
|
92049
|
-
return {
|
|
92050
|
-
error: { code, message: e.message || "internal error", ...e.details ? { details: e.details } : {} }
|
|
92051
|
-
};
|
|
92052
|
-
}
|
|
92053
|
-
function optionalString(value) {
|
|
92054
|
-
return typeof value === "string" && value.length > 0 ? value : null;
|
|
92055
|
-
}
|
|
92056
|
-
|
|
92057
92328
|
// ../../packages/runtime/src/server/session-settings.ts
|
|
92058
92329
|
var invalid2 = (message) => Object.assign(new Error(message), { code: "invalid_argument" });
|
|
92059
|
-
var STRING_KEYS = ["permissionMode", "sandboxMode", "model", "effort", "apiProviderId", "mode", "agentPreset"];
|
|
92330
|
+
var STRING_KEYS = ["permissionMode", "sandboxMode", "model", "effort", "apiProviderId", "mode", "agentPreset", "serviceTier", "permissionPreset", "collaborationMode", "agent"];
|
|
92060
92331
|
function parseSessionSettings(source) {
|
|
92061
92332
|
const patch = {};
|
|
92062
92333
|
for (const key of STRING_KEYS) {
|
|
@@ -92065,6 +92336,8 @@ function parseSessionSettings(source) {
|
|
|
92065
92336
|
if (value !== null && typeof value !== "string") throw invalid2(`${key} must be a string or null`);
|
|
92066
92337
|
patch[key] = value;
|
|
92067
92338
|
}
|
|
92339
|
+
if (patch.permissionPreset != null && !["read-only", "default", "auto-review", "full-access"].includes(patch.permissionPreset)) throw invalid2("invalid permission preset");
|
|
92340
|
+
if (patch.collaborationMode != null && !["default", "plan"].includes(patch.collaborationMode)) throw invalid2("invalid collaboration mode");
|
|
92068
92341
|
if (Object.hasOwn(source, "additionalDirectories")) {
|
|
92069
92342
|
const dirs = source.additionalDirectories;
|
|
92070
92343
|
if (dirs !== null && (!Array.isArray(dirs) || dirs.length > 64 || dirs.some((dir) => typeof dir !== "string" || !dir.trim()))) {
|
|
@@ -92072,6 +92345,15 @@ function parseSessionSettings(source) {
|
|
|
92072
92345
|
}
|
|
92073
92346
|
patch.additionalDirectories = dirs === null ? null : [...dirs];
|
|
92074
92347
|
}
|
|
92348
|
+
if (Object.hasOwn(source, "ultracode")) {
|
|
92349
|
+
if (source.ultracode !== null && typeof source.ultracode !== "boolean") throw invalid2("ultracode must be a boolean or null");
|
|
92350
|
+
patch.ultracode = source.ultracode;
|
|
92351
|
+
}
|
|
92352
|
+
if (Object.hasOwn(source, "contextWindow")) {
|
|
92353
|
+
const value = source.contextWindow;
|
|
92354
|
+
if (value !== null && (typeof value !== "number" || !Number.isInteger(value) || value <= 0)) throw invalid2("contextWindow must be a positive integer or null");
|
|
92355
|
+
patch.contextWindow = value;
|
|
92356
|
+
}
|
|
92075
92357
|
return patch;
|
|
92076
92358
|
}
|
|
92077
92359
|
|
|
@@ -92113,7 +92395,7 @@ function isAllowedSessionCwd(ctx, projectId, cwd) {
|
|
|
92113
92395
|
async function handleSessionCreate(payload, ctx) {
|
|
92114
92396
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
92115
92397
|
if (denied) return denied;
|
|
92116
|
-
const p3 =
|
|
92398
|
+
const p3 = asRecord(payload);
|
|
92117
92399
|
const rawHarnessId = typeof p3.harnessId === "string" ? p3.harnessId : "claude";
|
|
92118
92400
|
const harnessId = normalizeSessionHarnessId(rawHarnessId);
|
|
92119
92401
|
if (!harnessId) {
|
|
@@ -92174,7 +92456,7 @@ async function handleSessionCreate(payload, ctx) {
|
|
|
92174
92456
|
return { error: { code: "invalid_argument", message: "systemPromptAppend must be a string" } };
|
|
92175
92457
|
}
|
|
92176
92458
|
const systemPromptAppend = typeof p3.systemPromptAppend === "string" ? p3.systemPromptAppend : null;
|
|
92177
|
-
const externalParent =
|
|
92459
|
+
const externalParent = asRecord(p3.externalParent);
|
|
92178
92460
|
const externalParentSessionId = typeof externalParent.sessionId === "string" ? externalParent.sessionId.trim() : "";
|
|
92179
92461
|
if (p3.externalParent != null && !externalParentSessionId) {
|
|
92180
92462
|
return { error: { code: "invalid_argument", message: "externalParent.sessionId is required" } };
|
|
@@ -92182,7 +92464,7 @@ async function handleSessionCreate(payload, ctx) {
|
|
|
92182
92464
|
try {
|
|
92183
92465
|
const agentSettings = loadNodeAgentSettings(ctx.settingsConfigPath);
|
|
92184
92466
|
const defaults2 = resolveAgentTurnDefaults(agentSettings, harnessId);
|
|
92185
|
-
const options =
|
|
92467
|
+
const options = asRecord(p3.options);
|
|
92186
92468
|
const selectedSettings = parseSessionSettings({ ...p3, ...options });
|
|
92187
92469
|
const selections = parseSessionCreateSelections({ ...p3, ...options });
|
|
92188
92470
|
if (Object.keys(selections).length && !ctx.sessions.createOnHost) throw Object.assign(new Error("This host does not support native creation choices"), { code: "unsupported" });
|
|
@@ -92214,7 +92496,7 @@ async function handleSessionCreate(payload, ctx) {
|
|
|
92214
92496
|
defaults2.sandboxMode
|
|
92215
92497
|
);
|
|
92216
92498
|
const apiProviderId = pick4(options.apiProviderId, p3.apiProviderId, void 0, null);
|
|
92217
|
-
const extras = Object.fromEntries(["mode", "agentPreset", "additionalDirectories"].filter((key) => Object.hasOwn(selectedSettings, key)).map((key) => [key, selectedSettings[key]]));
|
|
92499
|
+
const extras = Object.fromEntries(["mode", "agentPreset", "additionalDirectories", "ultracode", "contextWindow", "serviceTier", "permissionPreset", "collaborationMode", "agent"].filter((key) => Object.hasOwn(selectedSettings, key)).map((key) => [key, selectedSettings[key]]));
|
|
92218
92500
|
if (Object.keys(extras).length) {
|
|
92219
92501
|
if (!ctx.sessions.validateSettings) throw Object.assign(new Error("This host does not support desktop harness settings"), { code: "unsupported" });
|
|
92220
92502
|
ctx.sessions.validateSettings(extras);
|
|
@@ -95283,6 +95565,19 @@ var NODE_MUTATING_METHODS = /* @__PURE__ */ new Set([
|
|
|
95283
95565
|
"git.worktreeActivate",
|
|
95284
95566
|
"git.worktreeAssignBranch",
|
|
95285
95567
|
"git.worktreeHandoff",
|
|
95568
|
+
"session.mcpAuthenticate",
|
|
95569
|
+
"session.reportWorktreeRemoved",
|
|
95570
|
+
"session.forceRecover",
|
|
95571
|
+
"session.scheduledSend.set",
|
|
95572
|
+
"session.scheduledSend.clear",
|
|
95573
|
+
"sessionList.deleteOlderThan",
|
|
95574
|
+
"session.sideChatStart",
|
|
95575
|
+
"session.sideChatClose",
|
|
95576
|
+
"session.stopTask",
|
|
95577
|
+
"session.startQueued",
|
|
95578
|
+
"session.reset",
|
|
95579
|
+
"session.rewind",
|
|
95580
|
+
"session.truncateAtCheckpoint",
|
|
95286
95581
|
"session.create",
|
|
95287
95582
|
"session.setCwd",
|
|
95288
95583
|
"session.patchSettings",
|
|
@@ -95861,7 +96156,7 @@ function agentEventOf(envelope, sessions) {
|
|
|
95861
96156
|
function handleSessionGet(payload, ctx) {
|
|
95862
96157
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
|
|
95863
96158
|
if (denied) return denied;
|
|
95864
|
-
const sessionId = String(
|
|
96159
|
+
const sessionId = String(asRecord(payload).sessionId ?? "");
|
|
95865
96160
|
if (!ctx.sessions) return mapThrown(unsupportedMethodError("session.get"));
|
|
95866
96161
|
const session = ctx.sessions.get(sessionId);
|
|
95867
96162
|
const config2 = session?.harnessId === "acp" ? ctx.sessionProviders?.get(session.providerId)?.config : void 0;
|
|
@@ -95869,7 +96164,7 @@ function handleSessionGet(payload, ctx) {
|
|
|
95869
96164
|
const { transcript, ...metadata } = session;
|
|
95870
96165
|
return { result: {
|
|
95871
96166
|
...metadata,
|
|
95872
|
-
...
|
|
96167
|
+
...asRecord(payload).includeTranscript === false ? {} : { transcript },
|
|
95873
96168
|
...session.harnessId === "acp" ? { acpAgentId: config2?.agentId ?? null } : {}
|
|
95874
96169
|
} };
|
|
95875
96170
|
}
|
|
@@ -95878,7 +96173,7 @@ async function handleSessionLoad(payload, ctx) {
|
|
|
95878
96173
|
if (denied) return denied;
|
|
95879
96174
|
const sessions = ctx.sessions;
|
|
95880
96175
|
if (!sessions) return mapThrown(unsupportedMethodError("session.load"));
|
|
95881
|
-
const p3 =
|
|
96176
|
+
const p3 = asRecord(payload);
|
|
95882
96177
|
const sessionId = String(p3.sessionId ?? "").trim();
|
|
95883
96178
|
if (!sessionId) return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
95884
96179
|
if (p3.projectId !== void 0) {
|
|
@@ -95888,6 +96183,7 @@ async function handleSessionLoad(payload, ctx) {
|
|
|
95888
96183
|
if (p3.before != null && typeof p3.before !== "number") return { error: { code: "invalid_argument", message: "before must be a non-negative integer" } };
|
|
95889
96184
|
if (p3.limit !== void 0 && typeof p3.limit !== "number") return { error: { code: "invalid_argument", message: "limit must be a positive integer" } };
|
|
95890
96185
|
if (p3.includeState !== void 0 && typeof p3.includeState !== "boolean") return { error: { code: "invalid_argument", message: "includeState must be boolean" } };
|
|
96186
|
+
if (p3.full !== void 0 && typeof p3.full !== "boolean") return { error: { code: "invalid_argument", message: "full must be boolean" } };
|
|
95891
96187
|
if (p3.anchorId !== void 0 && typeof p3.anchorId !== "string") return { error: { code: "invalid_argument", message: "anchorId must be a string" } };
|
|
95892
96188
|
if (p3.direction !== void 0 && p3.direction !== "around" && p3.direction !== "before" && p3.direction !== "after") return { error: { code: "invalid_argument", message: "direction must be around|before|after" } };
|
|
95893
96189
|
try {
|
|
@@ -95896,6 +96192,7 @@ async function handleSessionLoad(payload, ctx) {
|
|
|
95896
96192
|
includeState: p3.includeState,
|
|
95897
96193
|
before: typeof p3.before === "number" ? p3.before : null,
|
|
95898
96194
|
limit: typeof p3.limit === "number" ? p3.limit : void 0,
|
|
96195
|
+
...p3.full === true ? { full: true } : {},
|
|
95899
96196
|
anchorId: typeof p3.anchorId === "string" ? p3.anchorId : void 0,
|
|
95900
96197
|
direction: p3.direction
|
|
95901
96198
|
});
|
|
@@ -95911,7 +96208,7 @@ function handleSessionSubscribeDetail(payload, ctx) {
|
|
|
95911
96208
|
if (!sessions) return mapThrown(unsupportedMethodError("session.subscribeDetail"));
|
|
95912
96209
|
const delivery = ctx.streams?.delivery;
|
|
95913
96210
|
if (!delivery) return { error: { code: "failed_precondition", message: "session.subscribeDetail needs a socket connection" } };
|
|
95914
|
-
const p3 =
|
|
96211
|
+
const p3 = asRecord(payload);
|
|
95915
96212
|
const sessionId = String(p3.sessionId ?? "").trim();
|
|
95916
96213
|
const detailRef = String(p3.detailRef ?? "");
|
|
95917
96214
|
const subscriptionId = String(p3.subscriptionId ?? "").trim();
|
|
@@ -95923,7 +96220,7 @@ function handleSessionSubscribeDetail(payload, ctx) {
|
|
|
95923
96220
|
}
|
|
95924
96221
|
}
|
|
95925
96222
|
function handleSessionUnsubscribeDetail(payload, ctx) {
|
|
95926
|
-
const p3 =
|
|
96223
|
+
const p3 = asRecord(payload);
|
|
95927
96224
|
ctx.streams?.delivery?.views.unsubscribe(String(p3.sessionId ?? "").trim(), String(p3.subscriptionId ?? "").trim());
|
|
95928
96225
|
return { result: { ok: true } };
|
|
95929
96226
|
}
|
|
@@ -96032,7 +96329,7 @@ function combineStreams(...parts) {
|
|
|
96032
96329
|
function handleTopicSubscribe(payload, ctx, servesMethod) {
|
|
96033
96330
|
const streams = ctx.streams;
|
|
96034
96331
|
if (!streams) return { error: { code: "failed_precondition", message: "topic.subscribe needs a socket connection" } };
|
|
96035
|
-
const p3 =
|
|
96332
|
+
const p3 = asRecord(payload);
|
|
96036
96333
|
const subscriptionId = String(p3.subscriptionId ?? "").trim();
|
|
96037
96334
|
const afterSequence = String(p3.afterSequence ?? "").trim();
|
|
96038
96335
|
if (!subscriptionId) return { error: { code: "invalid_argument", message: "subscriptionId required" } };
|
|
@@ -96098,7 +96395,7 @@ function handleTopicSubscribe(payload, ctx, servesMethod) {
|
|
|
96098
96395
|
}
|
|
96099
96396
|
}
|
|
96100
96397
|
function handleTopicCatchUp(payload, ctx) {
|
|
96101
|
-
const p3 =
|
|
96398
|
+
const p3 = asRecord(payload);
|
|
96102
96399
|
const afterSequence = String(p3.afterSequence ?? "");
|
|
96103
96400
|
const versions = streamVersions(p3.versions);
|
|
96104
96401
|
const topics = readTopics(p3.topics);
|
|
@@ -96153,7 +96450,7 @@ function readTopics(value) {
|
|
|
96153
96450
|
return topics.every((topic2) => topic2 !== null) ? topics : null;
|
|
96154
96451
|
}
|
|
96155
96452
|
function handleTopicUpdate(payload, ctx) {
|
|
96156
|
-
const p3 =
|
|
96453
|
+
const p3 = asRecord(payload);
|
|
96157
96454
|
const stream = ctx.streams?.get(String(p3.subscriptionId ?? "").trim());
|
|
96158
96455
|
if (!stream) return { error: { code: "not_found", message: "no open stream with this subscriptionId" } };
|
|
96159
96456
|
const topics = readTopics(p3.topics);
|
|
@@ -96206,7 +96503,7 @@ function streamVersions(value) {
|
|
|
96206
96503
|
return Object.fromEntries(entries);
|
|
96207
96504
|
}
|
|
96208
96505
|
function handleTopicUnsubscribe(payload, ctx) {
|
|
96209
|
-
const subscriptionId = String(
|
|
96506
|
+
const subscriptionId = String(asRecord(payload).subscriptionId ?? "").trim();
|
|
96210
96507
|
ctx.streams?.close(subscriptionId);
|
|
96211
96508
|
return { result: { ok: true } };
|
|
96212
96509
|
}
|
|
@@ -96216,7 +96513,7 @@ init_environment();
|
|
|
96216
96513
|
function parseAttachments(value) {
|
|
96217
96514
|
if (!Array.isArray(value)) return [];
|
|
96218
96515
|
return value.flatMap((raw) => {
|
|
96219
|
-
const a =
|
|
96516
|
+
const a = asRecord(raw);
|
|
96220
96517
|
const name = typeof a.name === "string" ? a.name : "";
|
|
96221
96518
|
const mimeType = typeof a.mimeType === "string" ? a.mimeType : "";
|
|
96222
96519
|
const data = typeof a.data === "string" ? a.data : "";
|
|
@@ -96247,7 +96544,7 @@ var DRAFT_HANDLERS = {
|
|
|
96247
96544
|
"draft.list": (payload, ctx) => {
|
|
96248
96545
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
|
|
96249
96546
|
if (denied) return denied;
|
|
96250
|
-
const p3 =
|
|
96547
|
+
const p3 = asRecord(payload);
|
|
96251
96548
|
try {
|
|
96252
96549
|
const drafts = ctx.drafts.list(optionalString(p3.projectPath) ?? void 0);
|
|
96253
96550
|
return { result: { drafts: p3.omitAttachmentData === true ? drafts.map(withoutDraftAttachmentBytes) : drafts } };
|
|
@@ -96258,7 +96555,7 @@ var DRAFT_HANDLERS = {
|
|
|
96258
96555
|
"draft.upsert": (payload, ctx) => {
|
|
96259
96556
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
96260
96557
|
if (denied) return denied;
|
|
96261
|
-
const p3 =
|
|
96558
|
+
const p3 = asRecord(payload);
|
|
96262
96559
|
const input = parseUpsert(p3);
|
|
96263
96560
|
if (typeof input === "string") return invalid5(input);
|
|
96264
96561
|
const leaseId = optionalString(p3.leaseId) ?? void 0;
|
|
@@ -96278,7 +96575,7 @@ var DRAFT_HANDLERS = {
|
|
|
96278
96575
|
"draft.open": async (payload, ctx) => {
|
|
96279
96576
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
96280
96577
|
if (denied) return denied;
|
|
96281
|
-
const p3 =
|
|
96578
|
+
const p3 = asRecord(payload);
|
|
96282
96579
|
const draftId = optionalString(p3.draftId);
|
|
96283
96580
|
if (!draftId) return invalid5("draftId is required");
|
|
96284
96581
|
try {
|
|
@@ -96292,7 +96589,7 @@ var DRAFT_HANDLERS = {
|
|
|
96292
96589
|
"draft.close": (payload, ctx) => {
|
|
96293
96590
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
96294
96591
|
if (denied) return denied;
|
|
96295
|
-
const p3 =
|
|
96592
|
+
const p3 = asRecord(payload);
|
|
96296
96593
|
const draftId = optionalString(p3.draftId);
|
|
96297
96594
|
const leaseId = optionalString(p3.leaseId);
|
|
96298
96595
|
if (!draftId || !leaseId) return invalid5("draftId and leaseId are required");
|
|
@@ -96306,7 +96603,7 @@ var DRAFT_HANDLERS = {
|
|
|
96306
96603
|
"draft.delete": (payload, ctx) => {
|
|
96307
96604
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
96308
96605
|
if (denied) return denied;
|
|
96309
|
-
const p3 =
|
|
96606
|
+
const p3 = asRecord(payload);
|
|
96310
96607
|
const draftId = String(p3.draftId ?? "").trim();
|
|
96311
96608
|
if (!draftId) return invalid5("draftId is required");
|
|
96312
96609
|
const leaseId = optionalString(p3.leaseId) ?? void 0;
|
|
@@ -96347,7 +96644,7 @@ var TERMINAL_HANDLERS = {
|
|
|
96347
96644
|
function handleTerminalCreate(payload, ctx) {
|
|
96348
96645
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96349
96646
|
if (denied) return denied;
|
|
96350
|
-
const p3 =
|
|
96647
|
+
const p3 = asRecord(payload);
|
|
96351
96648
|
try {
|
|
96352
96649
|
const target = terminalWorkspace(p3, ctx);
|
|
96353
96650
|
const cwd = target?.cwd ?? (typeof p3.cwd === "string" ? p3.cwd : process.cwd());
|
|
@@ -96386,7 +96683,7 @@ function handleTerminalList(payload, ctx) {
|
|
|
96386
96683
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96387
96684
|
if (denied) return denied;
|
|
96388
96685
|
try {
|
|
96389
|
-
const target = terminalWorkspace(
|
|
96686
|
+
const target = terminalWorkspace(asRecord(payload), ctx);
|
|
96390
96687
|
const terminals = ctx.terminals.list().filter((item) => !target || item.cwd === target.cwd || item.cwd === target.projectPath || item.cwd.startsWith(target.projectPath.endsWith("/") ? target.projectPath : `${target.projectPath}/`));
|
|
96391
96688
|
return { result: { terminals } };
|
|
96392
96689
|
} catch (err) {
|
|
@@ -96396,7 +96693,7 @@ function handleTerminalList(payload, ctx) {
|
|
|
96396
96693
|
async function handleTerminalAttach(payload, ctx) {
|
|
96397
96694
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96398
96695
|
if (denied) return denied;
|
|
96399
|
-
const p3 =
|
|
96696
|
+
const p3 = asRecord(payload);
|
|
96400
96697
|
const terminalId = String(p3.terminalId ?? "");
|
|
96401
96698
|
try {
|
|
96402
96699
|
return { result: await ctx.terminals.attach(terminalId, ctx.client.clientSessionId) };
|
|
@@ -96407,7 +96704,7 @@ async function handleTerminalAttach(payload, ctx) {
|
|
|
96407
96704
|
async function handleTerminalRead(payload, ctx) {
|
|
96408
96705
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96409
96706
|
if (denied) return denied;
|
|
96410
|
-
const p3 =
|
|
96707
|
+
const p3 = asRecord(payload);
|
|
96411
96708
|
try {
|
|
96412
96709
|
return {
|
|
96413
96710
|
result: await ctx.terminals.readAfter(
|
|
@@ -96435,7 +96732,7 @@ function requireTerminalLease(payload, ctx, terminalId) {
|
|
|
96435
96732
|
function handleTerminalWrite(payload, ctx) {
|
|
96436
96733
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96437
96734
|
if (denied) return denied;
|
|
96438
|
-
const p3 =
|
|
96735
|
+
const p3 = asRecord(payload);
|
|
96439
96736
|
const terminalId = String(p3.terminalId ?? "");
|
|
96440
96737
|
const leaseErr = requireTerminalLease(p3, ctx, terminalId);
|
|
96441
96738
|
if (leaseErr) return leaseErr;
|
|
@@ -96453,7 +96750,7 @@ function handleTerminalWrite(payload, ctx) {
|
|
|
96453
96750
|
function handleTerminalResize(payload, ctx) {
|
|
96454
96751
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96455
96752
|
if (denied) return denied;
|
|
96456
|
-
const p3 =
|
|
96753
|
+
const p3 = asRecord(payload);
|
|
96457
96754
|
const terminalId = String(p3.terminalId ?? "");
|
|
96458
96755
|
const leaseErr = requireTerminalLease(p3, ctx, terminalId);
|
|
96459
96756
|
if (leaseErr) return leaseErr;
|
|
@@ -96469,7 +96766,7 @@ function handleTerminalResize(payload, ctx) {
|
|
|
96469
96766
|
function handleTerminalKill(payload, ctx) {
|
|
96470
96767
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96471
96768
|
if (denied) return denied;
|
|
96472
|
-
const p3 =
|
|
96769
|
+
const p3 = asRecord(payload);
|
|
96473
96770
|
const terminalId = String(p3.terminalId ?? "");
|
|
96474
96771
|
const leaseErr = requireTerminalLease(p3, ctx, terminalId);
|
|
96475
96772
|
if (leaseErr) return leaseErr;
|
|
@@ -96483,7 +96780,7 @@ function handleTerminalKill(payload, ctx) {
|
|
|
96483
96780
|
function handleTerminalAcquireControl(payload, ctx) {
|
|
96484
96781
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96485
96782
|
if (denied) return denied;
|
|
96486
|
-
const p3 =
|
|
96783
|
+
const p3 = asRecord(payload);
|
|
96487
96784
|
const terminalId = String(p3.terminalId ?? "");
|
|
96488
96785
|
try {
|
|
96489
96786
|
return {
|
|
@@ -96502,7 +96799,7 @@ function handleTerminalAcquireControl(payload, ctx) {
|
|
|
96502
96799
|
function handleTerminalRenewControl(payload, ctx) {
|
|
96503
96800
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96504
96801
|
if (denied) return denied;
|
|
96505
|
-
const p3 =
|
|
96802
|
+
const p3 = asRecord(payload);
|
|
96506
96803
|
try {
|
|
96507
96804
|
return {
|
|
96508
96805
|
result: ctx.leases.renew({
|
|
@@ -96519,7 +96816,7 @@ function handleTerminalRenewControl(payload, ctx) {
|
|
|
96519
96816
|
function handleTerminalReleaseControl(payload, ctx) {
|
|
96520
96817
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateTerminal);
|
|
96521
96818
|
if (denied) return denied;
|
|
96522
|
-
const p3 =
|
|
96819
|
+
const p3 = asRecord(payload);
|
|
96523
96820
|
try {
|
|
96524
96821
|
ctx.leases.release(
|
|
96525
96822
|
String(p3.leaseId ?? ""),
|
|
@@ -96534,7 +96831,7 @@ function handleTerminalReleaseControl(payload, ctx) {
|
|
|
96534
96831
|
|
|
96535
96832
|
// ../../packages/runtime/src/server/session-send-selections.ts
|
|
96536
96833
|
var invalid6 = (message) => Object.assign(new Error(message), { code: "invalid_argument" });
|
|
96537
|
-
var
|
|
96834
|
+
var record6 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
96538
96835
|
function parseSessionSendSelections(p3, options) {
|
|
96539
96836
|
const result2 = {};
|
|
96540
96837
|
const take = (key) => Object.hasOwn(options, key) ? options[key] : p3[key];
|
|
@@ -96567,12 +96864,12 @@ function parseSessionSendSelections(p3, options) {
|
|
|
96567
96864
|
}
|
|
96568
96865
|
const modelParams = take("modelParams");
|
|
96569
96866
|
if (modelParams !== void 0) {
|
|
96570
|
-
if (!
|
|
96867
|
+
if (!record6(modelParams) || Object.values(modelParams).some((value) => typeof value !== "string")) throw invalid6("modelParams must map names to string values");
|
|
96571
96868
|
result2.modelParams = { ...modelParams };
|
|
96572
96869
|
}
|
|
96573
96870
|
const inputRequest = take("inputRequest");
|
|
96574
96871
|
if (inputRequest !== void 0) {
|
|
96575
|
-
if (!
|
|
96872
|
+
if (!record6(inputRequest) || typeof inputRequest.requestId !== "string" || !inputRequest.requestId || !record6(inputRequest.values)) throw invalid6("inputRequest requires requestId and values");
|
|
96576
96873
|
if (typeof p3.clientMessageId !== "string" || !p3.clientMessageId) throw invalid6("inputRequest requires clientMessageId");
|
|
96577
96874
|
result2.inputRequest = { requestId: inputRequest.requestId, values: inputRequest.values };
|
|
96578
96875
|
}
|
|
@@ -96613,6 +96910,7 @@ function requiredPorts(method) {
|
|
|
96613
96910
|
}
|
|
96614
96911
|
function serves(ctx, method) {
|
|
96615
96912
|
if (ctx.unservedMethods?.has(method)) return false;
|
|
96913
|
+
if (Object.hasOwn(SESSION_OPERATION_HANDLERS, method) && !ctx.sessions?.servedOperations?.has(method)) return false;
|
|
96616
96914
|
return requiredPorts(method).every((port) => {
|
|
96617
96915
|
const served = ctx[port];
|
|
96618
96916
|
return served != null && (!served.servedMethods || served.servedMethods.has(method));
|
|
@@ -96699,6 +96997,7 @@ async function dispatchRpc(method, payload, ctx) {
|
|
|
96699
96997
|
return dispatchRpcInner(method, payload, ctx);
|
|
96700
96998
|
}
|
|
96701
96999
|
var HANDLERS = {
|
|
97000
|
+
...SESSION_OPERATION_HANDLERS,
|
|
96702
97001
|
"environment.descriptor": (_payload, ctx) => handleDescriptor(ctx),
|
|
96703
97002
|
"environment.health": (_payload, ctx) => handleHealth(ctx),
|
|
96704
97003
|
"environment.systemInfo": (_payload, ctx) => handleSystemInfo(ctx),
|
|
@@ -96824,7 +97123,7 @@ function handleProviderListCredentials(ctx) {
|
|
|
96824
97123
|
function handleProviderGetCredentialDecrypted(payload, ctx) {
|
|
96825
97124
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96826
97125
|
if (denied) return denied;
|
|
96827
|
-
const p3 =
|
|
97126
|
+
const p3 = asRecord(payload);
|
|
96828
97127
|
const cred = ctx.providers.getCredentialDecrypted(String(p3.id ?? ""));
|
|
96829
97128
|
if (!cred) return { error: { code: "not_found", message: "credential not found" } };
|
|
96830
97129
|
return { result: cred };
|
|
@@ -96832,7 +97131,7 @@ function handleProviderGetCredentialDecrypted(payload, ctx) {
|
|
|
96832
97131
|
function handleProviderCreateCredential(payload, ctx) {
|
|
96833
97132
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96834
97133
|
if (denied) return denied;
|
|
96835
|
-
const p3 =
|
|
97134
|
+
const p3 = asRecord(payload);
|
|
96836
97135
|
try {
|
|
96837
97136
|
return {
|
|
96838
97137
|
result: ctx.providers.createCredential({
|
|
@@ -96855,7 +97154,7 @@ function handleProviderCreateCredential(payload, ctx) {
|
|
|
96855
97154
|
function handleProviderUpdateCredential(payload, ctx) {
|
|
96856
97155
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96857
97156
|
if (denied) return denied;
|
|
96858
|
-
const p3 =
|
|
97157
|
+
const p3 = asRecord(payload);
|
|
96859
97158
|
const id = String(p3.id ?? "");
|
|
96860
97159
|
const updated = ctx.providers.updateCredential(id, {
|
|
96861
97160
|
name: typeof p3.name === "string" ? p3.name : void 0,
|
|
@@ -96873,7 +97172,7 @@ function handleProviderUpdateCredential(payload, ctx) {
|
|
|
96873
97172
|
function handleProviderDeleteCredential(payload, ctx) {
|
|
96874
97173
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96875
97174
|
if (denied) return denied;
|
|
96876
|
-
const p3 =
|
|
97175
|
+
const p3 = asRecord(payload);
|
|
96877
97176
|
const ok = ctx.providers.deleteCredential(String(p3.id ?? ""));
|
|
96878
97177
|
if (!ok) return { error: { code: "not_found", message: "credential not found" } };
|
|
96879
97178
|
return { result: { ok: true } };
|
|
@@ -96886,7 +97185,7 @@ function handleProviderListBindings(ctx) {
|
|
|
96886
97185
|
function handleProviderSetBinding(payload, ctx) {
|
|
96887
97186
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96888
97187
|
if (denied) return denied;
|
|
96889
|
-
const p3 =
|
|
97188
|
+
const p3 = asRecord(payload);
|
|
96890
97189
|
const binding = p3;
|
|
96891
97190
|
if (!binding.consumer || !binding.credentialId) {
|
|
96892
97191
|
return { error: { code: "invalid_argument", message: "consumer and credentialId required" } };
|
|
@@ -96897,7 +97196,7 @@ function handleProviderSetBinding(payload, ctx) {
|
|
|
96897
97196
|
function handleProviderClearBinding(payload, ctx) {
|
|
96898
97197
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96899
97198
|
if (denied) return denied;
|
|
96900
|
-
const p3 =
|
|
97199
|
+
const p3 = asRecord(payload);
|
|
96901
97200
|
ctx.providers.clearBinding(String(p3.consumer ?? ""));
|
|
96902
97201
|
return { result: { ok: true } };
|
|
96903
97202
|
}
|
|
@@ -96909,14 +97208,14 @@ function handleProviderListCustomPlatforms(ctx) {
|
|
|
96909
97208
|
function handleProviderUpsertCustomPlatform(payload, ctx) {
|
|
96910
97209
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96911
97210
|
if (denied) return denied;
|
|
96912
|
-
const def =
|
|
97211
|
+
const def = asRecord(payload);
|
|
96913
97212
|
if (!def?.id) return { error: { code: "invalid_argument", message: "platform id required" } };
|
|
96914
97213
|
return { result: ctx.providers.upsertCustomPlatform(def) };
|
|
96915
97214
|
}
|
|
96916
97215
|
function handleProviderDeleteCustomPlatform(payload, ctx) {
|
|
96917
97216
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96918
97217
|
if (denied) return denied;
|
|
96919
|
-
const p3 =
|
|
97218
|
+
const p3 = asRecord(payload);
|
|
96920
97219
|
const ok = ctx.providers.deleteCustomPlatform(String(p3.id ?? ""));
|
|
96921
97220
|
if (!ok) return { error: { code: "not_found", message: "custom platform not found" } };
|
|
96922
97221
|
return { result: { ok: true } };
|
|
@@ -96929,7 +97228,7 @@ function handleProviderExportBundle(ctx) {
|
|
|
96929
97228
|
function handleProviderListModels(payload, ctx) {
|
|
96930
97229
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readEnvironment);
|
|
96931
97230
|
if (denied) return denied;
|
|
96932
|
-
const p3 =
|
|
97231
|
+
const p3 = asRecord(payload);
|
|
96933
97232
|
const harness = String(p3.harness ?? p3.harnessId ?? "claude");
|
|
96934
97233
|
const apiProviderId = typeof p3.apiProviderId === "string" && p3.apiProviderId.trim() ? p3.apiProviderId.trim() : null;
|
|
96935
97234
|
return {
|
|
@@ -96941,7 +97240,7 @@ function handleProviderListModels(payload, ctx) {
|
|
|
96941
97240
|
function handleProviderImportBundle(payload, ctx) {
|
|
96942
97241
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
96943
97242
|
if (denied) return denied;
|
|
96944
|
-
const p3 =
|
|
97243
|
+
const p3 = asRecord(payload);
|
|
96945
97244
|
const bundle = p3.bundle && typeof p3.bundle === "object" ? p3.bundle : p3;
|
|
96946
97245
|
const replaceAll = p3.replaceAll === true;
|
|
96947
97246
|
try {
|
|
@@ -96998,7 +97297,7 @@ function handleHarnessList(ctx) {
|
|
|
96998
97297
|
function handleHarnessShow(payload, ctx) {
|
|
96999
97298
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
97000
97299
|
if (denied) return denied;
|
|
97001
|
-
const p3 =
|
|
97300
|
+
const p3 = asRecord(payload);
|
|
97002
97301
|
const id = typeof p3.harnessId === "string" ? p3.harnessId : typeof p3.id === "string" ? p3.id : "";
|
|
97003
97302
|
if (!isNodeHarnessId(id)) {
|
|
97004
97303
|
return { error: { code: "invalid_argument", message: `unknown harnessId: ${id}` } };
|
|
@@ -97008,7 +97307,7 @@ function handleHarnessShow(payload, ctx) {
|
|
|
97008
97307
|
function handleHarnessProbe(payload, ctx) {
|
|
97009
97308
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
97010
97309
|
if (denied) return denied;
|
|
97011
|
-
const p3 =
|
|
97310
|
+
const p3 = asRecord(payload);
|
|
97012
97311
|
const id = typeof p3.harnessId === "string" ? p3.harnessId : typeof p3.id === "string" ? p3.id : "";
|
|
97013
97312
|
if (!isNodeHarnessId(id)) {
|
|
97014
97313
|
return { error: { code: "invalid_argument", message: `unknown harnessId: ${id}` } };
|
|
@@ -97023,7 +97322,7 @@ function handleHarnessProbe(payload, ctx) {
|
|
|
97023
97322
|
async function handleHarnessEnable(payload, ctx) {
|
|
97024
97323
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
97025
97324
|
if (denied) return denied;
|
|
97026
|
-
const p3 =
|
|
97325
|
+
const p3 = asRecord(payload);
|
|
97027
97326
|
const id = typeof p3.harnessId === "string" ? p3.harnessId : typeof p3.id === "string" ? p3.id : "";
|
|
97028
97327
|
if (!isNodeHarnessId(id)) {
|
|
97029
97328
|
return { error: { code: "invalid_argument", message: `unknown harnessId: ${id}` } };
|
|
@@ -97049,7 +97348,7 @@ async function handleHarnessEnable(payload, ctx) {
|
|
|
97049
97348
|
function handleHarnessDisable(payload, ctx) {
|
|
97050
97349
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
97051
97350
|
if (denied) return denied;
|
|
97052
|
-
const p3 =
|
|
97351
|
+
const p3 = asRecord(payload);
|
|
97053
97352
|
const id = typeof p3.harnessId === "string" ? p3.harnessId : typeof p3.id === "string" ? p3.id : "";
|
|
97054
97353
|
if (!isNodeHarnessId(id)) {
|
|
97055
97354
|
return { error: { code: "invalid_argument", message: `unknown harnessId: ${id}` } };
|
|
@@ -97129,7 +97428,7 @@ function handleSettingsGet(ctx) {
|
|
|
97129
97428
|
function handleSettingsPatch(payload, ctx) {
|
|
97130
97429
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.adminNode);
|
|
97131
97430
|
if (denied) return denied;
|
|
97132
|
-
const p3 =
|
|
97431
|
+
const p3 = asRecord(payload);
|
|
97133
97432
|
const rawPatch = p3.patch && typeof p3.patch === "object" ? p3.patch : p3;
|
|
97134
97433
|
try {
|
|
97135
97434
|
const settings = patchNodeAgentSettings(
|
|
@@ -97158,7 +97457,7 @@ function handleProjectList(ctx) {
|
|
|
97158
97457
|
function handleProjectGet(payload, ctx) {
|
|
97159
97458
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readProject);
|
|
97160
97459
|
if (denied) return denied;
|
|
97161
|
-
const p3 =
|
|
97460
|
+
const p3 = asRecord(payload);
|
|
97162
97461
|
const projectId = String(p3.projectId ?? "");
|
|
97163
97462
|
return { result: ctx.projects.get(projectId) };
|
|
97164
97463
|
}
|
|
@@ -97174,7 +97473,7 @@ function expandHostPath(path) {
|
|
|
97174
97473
|
function handleProjectOpen(payload, ctx) {
|
|
97175
97474
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.manageProject);
|
|
97176
97475
|
if (denied) return denied;
|
|
97177
|
-
const p3 =
|
|
97476
|
+
const p3 = asRecord(payload);
|
|
97178
97477
|
const path = expandHostPath(String(p3.path ?? ""));
|
|
97179
97478
|
if (!path) {
|
|
97180
97479
|
return { error: { code: "invalid_argument", message: "path is required" } };
|
|
@@ -97192,7 +97491,7 @@ function handleProjectOpen(payload, ctx) {
|
|
|
97192
97491
|
function handleProjectUpdate(payload, ctx) {
|
|
97193
97492
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.manageProject);
|
|
97194
97493
|
if (denied) return denied;
|
|
97195
|
-
const p3 =
|
|
97494
|
+
const p3 = asRecord(payload);
|
|
97196
97495
|
const projectId = typeof p3.projectId === "string" && p3.projectId ? p3.projectId : void 0;
|
|
97197
97496
|
const pathRaw = typeof p3.path === "string" && p3.path ? expandHostPath(p3.path) : void 0;
|
|
97198
97497
|
if (!projectId && !pathRaw) {
|
|
@@ -97220,7 +97519,7 @@ function handleProjectUpdate(payload, ctx) {
|
|
|
97220
97519
|
function handleProjectRemove(payload, ctx) {
|
|
97221
97520
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.manageProject);
|
|
97222
97521
|
if (denied) return denied;
|
|
97223
|
-
const p3 =
|
|
97522
|
+
const p3 = asRecord(payload);
|
|
97224
97523
|
const projectId = typeof p3.projectId === "string" && p3.projectId ? p3.projectId : void 0;
|
|
97225
97524
|
const pathRaw = typeof p3.path === "string" && p3.path ? expandHostPath(p3.path) : void 0;
|
|
97226
97525
|
if (!projectId && !pathRaw) {
|
|
@@ -97239,7 +97538,7 @@ function handleProjectRemove(payload, ctx) {
|
|
|
97239
97538
|
function handleFsListDir(payload, ctx) {
|
|
97240
97539
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97241
97540
|
if (denied) return denied;
|
|
97242
|
-
const p3 =
|
|
97541
|
+
const p3 = asRecord(payload);
|
|
97243
97542
|
const raw = String(p3.path ?? "");
|
|
97244
97543
|
if (!raw || raw.includes("\0")) {
|
|
97245
97544
|
return { error: { code: "invalid_argument", message: "path is required" } };
|
|
@@ -97265,7 +97564,7 @@ function handleFsListDir(payload, ctx) {
|
|
|
97265
97564
|
function handleWorkspaceListDir(payload, ctx) {
|
|
97266
97565
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97267
97566
|
if (denied) return denied;
|
|
97268
|
-
const p3 =
|
|
97567
|
+
const p3 = asRecord(payload);
|
|
97269
97568
|
try {
|
|
97270
97569
|
return {
|
|
97271
97570
|
result: ctx.workspaceFs.listDir(String(p3.projectId ?? ""), String(p3.relativePath ?? "."))
|
|
@@ -97277,7 +97576,7 @@ function handleWorkspaceListDir(payload, ctx) {
|
|
|
97277
97576
|
function handleWorkspaceListFiles(payload, ctx) {
|
|
97278
97577
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97279
97578
|
if (denied) return denied;
|
|
97280
|
-
const p3 =
|
|
97579
|
+
const p3 = asRecord(payload);
|
|
97281
97580
|
try {
|
|
97282
97581
|
return {
|
|
97283
97582
|
result: {
|
|
@@ -97295,7 +97594,7 @@ function handleWorkspaceListFiles(payload, ctx) {
|
|
|
97295
97594
|
function handleWorkspaceListSkills(payload, ctx) {
|
|
97296
97595
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97297
97596
|
if (denied) return denied;
|
|
97298
|
-
const p3 =
|
|
97597
|
+
const p3 = asRecord(payload);
|
|
97299
97598
|
try {
|
|
97300
97599
|
return {
|
|
97301
97600
|
result: ctx.workspaceFs.listSkillsAndCommands(String(p3.projectId ?? ""))
|
|
@@ -97307,7 +97606,7 @@ function handleWorkspaceListSkills(payload, ctx) {
|
|
|
97307
97606
|
function handleWorkspaceReadFile(payload, ctx) {
|
|
97308
97607
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97309
97608
|
if (denied) return denied;
|
|
97310
|
-
const p3 =
|
|
97609
|
+
const p3 = asRecord(payload);
|
|
97311
97610
|
try {
|
|
97312
97611
|
return {
|
|
97313
97612
|
result: ctx.workspaceFs.readFile(String(p3.projectId ?? ""), String(p3.relativePath ?? ""), {
|
|
@@ -97322,7 +97621,7 @@ function handleWorkspaceReadFile(payload, ctx) {
|
|
|
97322
97621
|
function handleWorkspaceWriteFile(payload, ctx) {
|
|
97323
97622
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97324
97623
|
if (denied) return denied;
|
|
97325
|
-
const p3 =
|
|
97624
|
+
const p3 = asRecord(payload);
|
|
97326
97625
|
const raw = typeof p3.content === "string" ? p3.content : String(p3.content ?? "");
|
|
97327
97626
|
const encoding = p3.encoding === "base64" ? "base64" : "utf8";
|
|
97328
97627
|
let content = raw;
|
|
@@ -97352,7 +97651,7 @@ function handleWorkspaceWriteFile(payload, ctx) {
|
|
|
97352
97651
|
function handleWorkspaceSearch(payload, ctx) {
|
|
97353
97652
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97354
97653
|
if (denied) return denied;
|
|
97355
|
-
const p3 =
|
|
97654
|
+
const p3 = asRecord(payload);
|
|
97356
97655
|
try {
|
|
97357
97656
|
return {
|
|
97358
97657
|
result: ctx.workspaceFs.search(
|
|
@@ -97368,7 +97667,7 @@ function handleWorkspaceSearch(payload, ctx) {
|
|
|
97368
97667
|
function handleWorkspaceRename(payload, ctx) {
|
|
97369
97668
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97370
97669
|
if (denied) return denied;
|
|
97371
|
-
const p3 =
|
|
97670
|
+
const p3 = asRecord(payload);
|
|
97372
97671
|
try {
|
|
97373
97672
|
return {
|
|
97374
97673
|
result: ctx.workspaceFs.rename(
|
|
@@ -97384,7 +97683,7 @@ function handleWorkspaceRename(payload, ctx) {
|
|
|
97384
97683
|
function handleWorkspaceMove(payload, ctx) {
|
|
97385
97684
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97386
97685
|
if (denied) return denied;
|
|
97387
|
-
const p3 =
|
|
97686
|
+
const p3 = asRecord(payload);
|
|
97388
97687
|
try {
|
|
97389
97688
|
return {
|
|
97390
97689
|
result: ctx.workspaceFs.move(
|
|
@@ -97400,7 +97699,7 @@ function handleWorkspaceMove(payload, ctx) {
|
|
|
97400
97699
|
function handleWorkspaceDelete(payload, ctx) {
|
|
97401
97700
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97402
97701
|
if (denied) return denied;
|
|
97403
|
-
const p3 =
|
|
97702
|
+
const p3 = asRecord(payload);
|
|
97404
97703
|
try {
|
|
97405
97704
|
return {
|
|
97406
97705
|
result: ctx.workspaceFs.delete(
|
|
@@ -97415,7 +97714,7 @@ function handleWorkspaceDelete(payload, ctx) {
|
|
|
97415
97714
|
function handleWorkspaceMkdir(payload, ctx) {
|
|
97416
97715
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97417
97716
|
if (denied) return denied;
|
|
97418
|
-
const p3 =
|
|
97717
|
+
const p3 = asRecord(payload);
|
|
97419
97718
|
try {
|
|
97420
97719
|
return {
|
|
97421
97720
|
result: ctx.workspaceFs.mkdir(
|
|
@@ -97430,7 +97729,7 @@ function handleWorkspaceMkdir(payload, ctx) {
|
|
|
97430
97729
|
function handleWorkspaceWatchStart(payload, ctx) {
|
|
97431
97730
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97432
97731
|
if (denied) return denied;
|
|
97433
|
-
const p3 =
|
|
97732
|
+
const p3 = asRecord(payload);
|
|
97434
97733
|
try {
|
|
97435
97734
|
const events = [];
|
|
97436
97735
|
const { watchId, cancel } = ctx.workspaceWatch.subscribe(
|
|
@@ -97451,7 +97750,7 @@ function handleWorkspaceWatchStart(payload, ctx) {
|
|
|
97451
97750
|
function handleWorkspaceWatchPoll(payload, ctx) {
|
|
97452
97751
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97453
97752
|
if (denied) return denied;
|
|
97454
|
-
const p3 =
|
|
97753
|
+
const p3 = asRecord(payload);
|
|
97455
97754
|
const watchId = String(p3.watchId ?? "");
|
|
97456
97755
|
const buf = watchBuffers.get(watchId);
|
|
97457
97756
|
if (!buf || buf.owner !== ctx.client.clientSessionId) {
|
|
@@ -97463,7 +97762,7 @@ function handleWorkspaceWatchPoll(payload, ctx) {
|
|
|
97463
97762
|
function handleWorkspaceWatchStop(payload, ctx) {
|
|
97464
97763
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97465
97764
|
if (denied) return denied;
|
|
97466
|
-
const p3 =
|
|
97765
|
+
const p3 = asRecord(payload);
|
|
97467
97766
|
const watchId = String(p3.watchId ?? "");
|
|
97468
97767
|
const buf = watchBuffers.get(watchId);
|
|
97469
97768
|
if (buf && buf.owner === ctx.client.clientSessionId) {
|
|
@@ -97475,7 +97774,7 @@ function handleWorkspaceWatchStop(payload, ctx) {
|
|
|
97475
97774
|
function handleWorkspaceTailWatchStart(payload, ctx) {
|
|
97476
97775
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97477
97776
|
if (denied) return denied;
|
|
97478
|
-
const p3 =
|
|
97777
|
+
const p3 = asRecord(payload);
|
|
97479
97778
|
try {
|
|
97480
97779
|
const offset = typeof p3.offset === "number" ? p3.offset : void 0;
|
|
97481
97780
|
const absolutePath2 = typeof p3.absolutePath === "string" ? p3.absolutePath : void 0;
|
|
@@ -97493,7 +97792,7 @@ function handleWorkspaceTailWatchStart(payload, ctx) {
|
|
|
97493
97792
|
function handleWorkspaceTailWatchPoll(payload, ctx) {
|
|
97494
97793
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97495
97794
|
if (denied) return denied;
|
|
97496
|
-
const p3 =
|
|
97795
|
+
const p3 = asRecord(payload);
|
|
97497
97796
|
try {
|
|
97498
97797
|
return {
|
|
97499
97798
|
result: ctx.workspaceTailWatch.poll(String(p3.watchId ?? ""), ctx.client.clientSessionId)
|
|
@@ -97505,7 +97804,7 @@ function handleWorkspaceTailWatchPoll(payload, ctx) {
|
|
|
97505
97804
|
function handleWorkspaceTailWatchStop(payload, ctx) {
|
|
97506
97805
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97507
97806
|
if (denied) return denied;
|
|
97508
|
-
const p3 =
|
|
97807
|
+
const p3 = asRecord(payload);
|
|
97509
97808
|
try {
|
|
97510
97809
|
return {
|
|
97511
97810
|
result: ctx.workspaceTailWatch.stop(String(p3.watchId ?? ""), ctx.client.clientSessionId)
|
|
@@ -97517,7 +97816,7 @@ function handleWorkspaceTailWatchStop(payload, ctx) {
|
|
|
97517
97816
|
function handleGitStatus(payload, ctx) {
|
|
97518
97817
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97519
97818
|
if (denied) return denied;
|
|
97520
|
-
const p3 =
|
|
97819
|
+
const p3 = asRecord(payload);
|
|
97521
97820
|
try {
|
|
97522
97821
|
const projectId = String(p3.projectId ?? "");
|
|
97523
97822
|
const cwd = typeof p3.cwd === "string" ? p3.cwd : null;
|
|
@@ -97531,7 +97830,7 @@ function handleGitStatus(payload, ctx) {
|
|
|
97531
97830
|
function handleGitDiff(payload, ctx) {
|
|
97532
97831
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97533
97832
|
if (denied) return denied;
|
|
97534
|
-
const p3 =
|
|
97833
|
+
const p3 = asRecord(payload);
|
|
97535
97834
|
try {
|
|
97536
97835
|
return {
|
|
97537
97836
|
result: ctx.workspaceGit.diff(String(p3.projectId ?? ""), {
|
|
@@ -97546,7 +97845,7 @@ function handleGitDiff(payload, ctx) {
|
|
|
97546
97845
|
function handleGitBranches(payload, ctx) {
|
|
97547
97846
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97548
97847
|
if (denied) return denied;
|
|
97549
|
-
const p3 =
|
|
97848
|
+
const p3 = asRecord(payload);
|
|
97550
97849
|
try {
|
|
97551
97850
|
return {
|
|
97552
97851
|
result: ctx.workspaceGit.branches(
|
|
@@ -97561,7 +97860,7 @@ function handleGitBranches(payload, ctx) {
|
|
|
97561
97860
|
function handleGitSwitchBranch(payload, ctx) {
|
|
97562
97861
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97563
97862
|
if (denied) return denied;
|
|
97564
|
-
const p3 =
|
|
97863
|
+
const p3 = asRecord(payload);
|
|
97565
97864
|
try {
|
|
97566
97865
|
return {
|
|
97567
97866
|
result: ctx.workspaceGit.switchBranch(String(p3.projectId ?? ""), String(p3.branch ?? ""), {
|
|
@@ -97576,7 +97875,7 @@ function handleGitSwitchBranch(payload, ctx) {
|
|
|
97576
97875
|
function handleGitCreateBranch(payload, ctx) {
|
|
97577
97876
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97578
97877
|
if (denied) return denied;
|
|
97579
|
-
const p3 =
|
|
97878
|
+
const p3 = asRecord(payload);
|
|
97580
97879
|
try {
|
|
97581
97880
|
return {
|
|
97582
97881
|
result: ctx.workspaceGit.switchBranch(String(p3.projectId ?? ""), String(p3.branch ?? ""), {
|
|
@@ -97591,7 +97890,7 @@ function handleGitCreateBranch(payload, ctx) {
|
|
|
97591
97890
|
async function handleGitMentionCapabilities(payload, ctx) {
|
|
97592
97891
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97593
97892
|
if (denied) return denied;
|
|
97594
|
-
const p3 =
|
|
97893
|
+
const p3 = asRecord(payload);
|
|
97595
97894
|
try {
|
|
97596
97895
|
return {
|
|
97597
97896
|
result: await ctx.workspaceGit.mentionCapabilities(
|
|
@@ -97606,7 +97905,7 @@ async function handleGitMentionCapabilities(payload, ctx) {
|
|
|
97606
97905
|
async function handleGitMentionRefs(payload, ctx) {
|
|
97607
97906
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97608
97907
|
if (denied) return denied;
|
|
97609
|
-
const p3 =
|
|
97908
|
+
const p3 = asRecord(payload);
|
|
97610
97909
|
if (!isGitMentionRefKind(p3.kind)) {
|
|
97611
97910
|
return { error: { code: "invalid_argument", message: "kind must be branch | commit | worktree | tag | issue | pr" } };
|
|
97612
97911
|
}
|
|
@@ -97626,7 +97925,7 @@ async function handleGitMentionRefs(payload, ctx) {
|
|
|
97626
97925
|
function handleGitWorktrees(payload, ctx) {
|
|
97627
97926
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97628
97927
|
if (denied) return denied;
|
|
97629
|
-
const p3 =
|
|
97928
|
+
const p3 = asRecord(payload);
|
|
97630
97929
|
try {
|
|
97631
97930
|
return { result: ctx.workspaceGit.worktrees(String(p3.projectId ?? "")) };
|
|
97632
97931
|
} catch (err) {
|
|
@@ -97636,7 +97935,7 @@ function handleGitWorktrees(payload, ctx) {
|
|
|
97636
97935
|
async function handleGitFetch(payload, ctx) {
|
|
97637
97936
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97638
97937
|
if (denied) return denied;
|
|
97639
|
-
const p3 =
|
|
97938
|
+
const p3 = asRecord(payload);
|
|
97640
97939
|
const remote = typeof p3.remote === "string" && p3.remote.trim() ? p3.remote.trim() : "origin";
|
|
97641
97940
|
if (!isGitRemoteName(remote)) return { error: { code: "invalid_argument", message: "invalid remote name" } };
|
|
97642
97941
|
try {
|
|
@@ -97649,7 +97948,7 @@ async function handleGitFetch(payload, ctx) {
|
|
|
97649
97948
|
async function handleGitWorktreeActivate(payload, ctx) {
|
|
97650
97949
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97651
97950
|
if (denied) return denied;
|
|
97652
|
-
const p3 =
|
|
97951
|
+
const p3 = asRecord(payload);
|
|
97653
97952
|
const mode = p3.mode === "attach" || p3.mode === "detach" || p3.mode === "branch" ? p3.mode : null;
|
|
97654
97953
|
if (!mode) {
|
|
97655
97954
|
return { error: { code: "invalid_argument", message: "mode must be branch|attach|detach" } };
|
|
@@ -97670,7 +97969,7 @@ async function handleGitWorktreeActivate(payload, ctx) {
|
|
|
97670
97969
|
function handleGitWorktreeCheckedOutBranches(payload, ctx) {
|
|
97671
97970
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97672
97971
|
if (denied) return denied;
|
|
97673
|
-
const p3 =
|
|
97972
|
+
const p3 = asRecord(payload);
|
|
97674
97973
|
try {
|
|
97675
97974
|
return { result: { branches: ctx.workspaceGit.checkedOutBranches(String(p3.projectId ?? "")) } };
|
|
97676
97975
|
} catch (err) {
|
|
@@ -97680,7 +97979,7 @@ function handleGitWorktreeCheckedOutBranches(payload, ctx) {
|
|
|
97680
97979
|
function handleGitWorktreeAssignBranch(payload, ctx) {
|
|
97681
97980
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97682
97981
|
if (denied) return denied;
|
|
97683
|
-
const p3 =
|
|
97982
|
+
const p3 = asRecord(payload);
|
|
97684
97983
|
try {
|
|
97685
97984
|
return {
|
|
97686
97985
|
result: ctx.workspaceGit.assignBranch(
|
|
@@ -97696,7 +97995,7 @@ function handleGitWorktreeAssignBranch(payload, ctx) {
|
|
|
97696
97995
|
function handleGitWorktreeHandoff(payload, ctx) {
|
|
97697
97996
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.writeWorkspace);
|
|
97698
97997
|
if (denied) return denied;
|
|
97699
|
-
const p3 =
|
|
97998
|
+
const p3 = asRecord(payload);
|
|
97700
97999
|
try {
|
|
97701
98000
|
return {
|
|
97702
98001
|
result: ctx.workspaceGit.handoffToMain(
|
|
@@ -97711,7 +98010,7 @@ function handleGitWorktreeHandoff(payload, ctx) {
|
|
|
97711
98010
|
function handleGitWorktreeHandoffPreview(payload, ctx) {
|
|
97712
98011
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readWorkspace);
|
|
97713
98012
|
if (denied) return denied;
|
|
97714
|
-
const p3 =
|
|
98013
|
+
const p3 = asRecord(payload);
|
|
97715
98014
|
try {
|
|
97716
98015
|
return {
|
|
97717
98016
|
result: ctx.workspaceGit.handoffPreview(
|
|
@@ -97726,7 +98025,7 @@ function handleGitWorktreeHandoffPreview(payload, ctx) {
|
|
|
97726
98025
|
async function handleSessionSetCwd(payload, ctx) {
|
|
97727
98026
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
97728
98027
|
if (denied) return denied;
|
|
97729
|
-
const p3 =
|
|
98028
|
+
const p3 = asRecord(payload);
|
|
97730
98029
|
const sessionId = String(p3.sessionId ?? "");
|
|
97731
98030
|
const cwdRaw = p3.cwd;
|
|
97732
98031
|
const cwd = cwdRaw === null || cwdRaw === void 0 || cwdRaw === "" ? null : String(cwdRaw);
|
|
@@ -97755,7 +98054,7 @@ async function handleSessionSetCwd(payload, ctx) {
|
|
|
97755
98054
|
async function handleSessionPatchSettings(payload, ctx) {
|
|
97756
98055
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
97757
98056
|
if (denied) return denied;
|
|
97758
|
-
const p3 =
|
|
98057
|
+
const p3 = asRecord(payload);
|
|
97759
98058
|
const sessionId = String(p3.sessionId ?? "").trim();
|
|
97760
98059
|
if (!sessionId) {
|
|
97761
98060
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -97771,7 +98070,7 @@ async function handleSessionPatchSettings(payload, ctx) {
|
|
|
97771
98070
|
generation: String(p3.generation ?? ""),
|
|
97772
98071
|
holderClientId: ctx.client.clientSessionId
|
|
97773
98072
|
});
|
|
97774
|
-
const settingsSrc =
|
|
98073
|
+
const settingsSrc = asRecord(p3.settings ?? p3);
|
|
97775
98074
|
const patch = parseSessionSettings(settingsSrc);
|
|
97776
98075
|
return { result: await ctx.sessions.patchSettings(sessionId, patch) };
|
|
97777
98076
|
} catch (err) {
|
|
@@ -97781,7 +98080,7 @@ async function handleSessionPatchSettings(payload, ctx) {
|
|
|
97781
98080
|
async function handleSessionFork(payload, ctx) {
|
|
97782
98081
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
97783
98082
|
if (denied) return denied;
|
|
97784
|
-
const p3 =
|
|
98083
|
+
const p3 = asRecord(payload);
|
|
97785
98084
|
const sessionId = String(p3.sessionId ?? "").trim();
|
|
97786
98085
|
if (!sessionId) {
|
|
97787
98086
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -97890,7 +98189,7 @@ function existingCloneTarget(input) {
|
|
|
97890
98189
|
async function handleGitClone(payload, ctx) {
|
|
97891
98190
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.manageProject);
|
|
97892
98191
|
if (denied) return denied;
|
|
97893
|
-
const p3 =
|
|
98192
|
+
const p3 = asRecord(payload);
|
|
97894
98193
|
try {
|
|
97895
98194
|
const parentPath = typeof p3.parentPath === "string" && p3.parentPath.trim() ? p3.parentPath : nodeProjectsDir(loadNodeAgentSettings(ctx.settingsConfigPath));
|
|
97896
98195
|
const input = {
|
|
@@ -97936,7 +98235,7 @@ function mapSessionRow(s4) {
|
|
|
97936
98235
|
function handleSessionList(payload, ctx) {
|
|
97937
98236
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
|
|
97938
98237
|
if (denied) return denied;
|
|
97939
|
-
const p3 =
|
|
98238
|
+
const p3 = asRecord(payload);
|
|
97940
98239
|
const projectId = typeof p3.projectId === "string" ? p3.projectId : void 0;
|
|
97941
98240
|
if (typeof p3.limit !== "number" || !Number.isFinite(p3.limit)) {
|
|
97942
98241
|
return { error: { code: "invalid_argument", message: "session.list requires finite limit" } };
|
|
@@ -97952,7 +98251,7 @@ function handleSessionList(payload, ctx) {
|
|
|
97952
98251
|
function handleSessionListPinned(payload, ctx) {
|
|
97953
98252
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
|
|
97954
98253
|
if (denied) return denied;
|
|
97955
|
-
const p3 =
|
|
98254
|
+
const p3 = asRecord(payload);
|
|
97956
98255
|
const limit2 = typeof p3.limit === "number" && Number.isFinite(p3.limit) ? Math.min(Math.max(Math.floor(p3.limit), 0), 500) : 200;
|
|
97957
98256
|
const rows = ctx.sessions.list(void 0).filter((s4) => s4.isPinned === true && s4.isHidden !== true).slice(0, limit2);
|
|
97958
98257
|
return {
|
|
@@ -97969,7 +98268,7 @@ function handleSessionListPinned(payload, ctx) {
|
|
|
97969
98268
|
function handleSessionAcquireControl(payload, ctx) {
|
|
97970
98269
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
97971
98270
|
if (denied) return denied;
|
|
97972
|
-
const p3 =
|
|
98271
|
+
const p3 = asRecord(payload);
|
|
97973
98272
|
const sessionId = String(p3.sessionId ?? "");
|
|
97974
98273
|
if (!sessionId) {
|
|
97975
98274
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -98002,7 +98301,7 @@ function handleSessionAcquireControl(payload, ctx) {
|
|
|
98002
98301
|
function handleSessionRenewControl(payload, ctx) {
|
|
98003
98302
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98004
98303
|
if (denied) return denied;
|
|
98005
|
-
const p3 =
|
|
98304
|
+
const p3 = asRecord(payload);
|
|
98006
98305
|
try {
|
|
98007
98306
|
return {
|
|
98008
98307
|
result: ctx.leases.renew({
|
|
@@ -98019,7 +98318,7 @@ function handleSessionRenewControl(payload, ctx) {
|
|
|
98019
98318
|
function handleSessionReleaseControl(payload, ctx) {
|
|
98020
98319
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98021
98320
|
if (denied) return denied;
|
|
98022
|
-
const p3 =
|
|
98321
|
+
const p3 = asRecord(payload);
|
|
98023
98322
|
try {
|
|
98024
98323
|
ctx.leases.release(
|
|
98025
98324
|
String(p3.leaseId ?? ""),
|
|
@@ -98034,7 +98333,7 @@ function handleSessionReleaseControl(payload, ctx) {
|
|
|
98034
98333
|
async function handleSessionClose(payload, ctx) {
|
|
98035
98334
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98036
98335
|
if (denied) return denied;
|
|
98037
|
-
const p3 =
|
|
98336
|
+
const p3 = asRecord(payload);
|
|
98038
98337
|
const sessionId = String(p3.sessionId ?? "");
|
|
98039
98338
|
try {
|
|
98040
98339
|
ctx.leases.assertValid({
|
|
@@ -98060,7 +98359,7 @@ async function handleSessionClose(payload, ctx) {
|
|
|
98060
98359
|
async function handleSessionRemove(payload, ctx) {
|
|
98061
98360
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98062
98361
|
if (denied) return denied;
|
|
98063
|
-
const p3 =
|
|
98362
|
+
const p3 = asRecord(payload);
|
|
98064
98363
|
const sessionId = String(p3.sessionId ?? "");
|
|
98065
98364
|
if (!sessionId) {
|
|
98066
98365
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -98088,7 +98387,7 @@ async function handleSessionRemove(payload, ctx) {
|
|
|
98088
98387
|
function handleSessionRename(payload, ctx) {
|
|
98089
98388
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98090
98389
|
if (denied) return denied;
|
|
98091
|
-
const p3 =
|
|
98390
|
+
const p3 = asRecord(payload);
|
|
98092
98391
|
const sessionId = String(p3.sessionId ?? "");
|
|
98093
98392
|
const title2 = String(p3.title ?? "");
|
|
98094
98393
|
const source = p3.source === "agent" ? "agent" : "user";
|
|
@@ -98104,7 +98403,7 @@ function handleSessionRename(payload, ctx) {
|
|
|
98104
98403
|
function handleSessionSetTags(payload, ctx) {
|
|
98105
98404
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98106
98405
|
if (denied) return denied;
|
|
98107
|
-
const p3 =
|
|
98406
|
+
const p3 = asRecord(payload);
|
|
98108
98407
|
const sessionId = String(p3.sessionId ?? "");
|
|
98109
98408
|
if (!sessionId) {
|
|
98110
98409
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -98130,7 +98429,7 @@ function handleSessionSetTags(payload, ctx) {
|
|
|
98130
98429
|
function handleSessionSetUiFlags(payload, ctx) {
|
|
98131
98430
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98132
98431
|
if (denied) return denied;
|
|
98133
|
-
const p3 =
|
|
98432
|
+
const p3 = asRecord(payload);
|
|
98134
98433
|
const sessionId = String(p3.sessionId ?? "");
|
|
98135
98434
|
if (!sessionId) {
|
|
98136
98435
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -98160,9 +98459,9 @@ function attachmentOriginal(zone, sessionId, path) {
|
|
|
98160
98459
|
async function handleSessionSend(payload, ctx) {
|
|
98161
98460
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98162
98461
|
if (denied) return denied;
|
|
98163
|
-
const p3 =
|
|
98462
|
+
const p3 = asRecord(payload);
|
|
98164
98463
|
try {
|
|
98165
|
-
const options =
|
|
98464
|
+
const options = asRecord(p3.options);
|
|
98166
98465
|
const selections = parseSessionSendSelections(p3, options);
|
|
98167
98466
|
const modelFromOptions = typeof options.model === "string" && options.model.trim() ? options.model.trim() : null;
|
|
98168
98467
|
const modelTopLevel = typeof p3.model === "string" && p3.model.trim() ? p3.model.trim() : null;
|
|
@@ -98275,7 +98574,7 @@ async function handleSessionSend(payload, ctx) {
|
|
|
98275
98574
|
}
|
|
98276
98575
|
}
|
|
98277
98576
|
async function handleSessionModUi(payload, ctx) {
|
|
98278
|
-
const p3 =
|
|
98577
|
+
const p3 = asRecord(payload);
|
|
98279
98578
|
const op = String(p3.op ?? "");
|
|
98280
98579
|
const denied = requireScopes(ctx.client, MOD_UI_MUTATING_OPS.has(op) ? OPERATION_SCOPES.operateSession : OPERATION_SCOPES.readSession);
|
|
98281
98580
|
if (denied) return denied;
|
|
@@ -98283,7 +98582,7 @@ async function handleSessionModUi(payload, ctx) {
|
|
|
98283
98582
|
const result2 = await ctx.sessions.modUi({
|
|
98284
98583
|
sessionId: String(p3.sessionId ?? ""),
|
|
98285
98584
|
op,
|
|
98286
|
-
request:
|
|
98585
|
+
request: asRecord(p3.request),
|
|
98287
98586
|
client: { clientSessionId: ctx.client.clientSessionId },
|
|
98288
98587
|
leaseId: typeof p3.leaseId === "string" ? p3.leaseId : void 0,
|
|
98289
98588
|
generation: typeof p3.generation === "string" ? p3.generation : void 0
|
|
@@ -98299,7 +98598,7 @@ async function handleSessionModUi(payload, ctx) {
|
|
|
98299
98598
|
function handleSessionInterrupt(payload, ctx) {
|
|
98300
98599
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98301
98600
|
if (denied) return denied;
|
|
98302
|
-
const p3 =
|
|
98601
|
+
const p3 = asRecord(payload);
|
|
98303
98602
|
try {
|
|
98304
98603
|
ctx.sessions.interrupt(
|
|
98305
98604
|
String(p3.sessionId ?? ""),
|
|
@@ -98315,7 +98614,7 @@ function handleSessionInterrupt(payload, ctx) {
|
|
|
98315
98614
|
function handleSessionRespondPermission(payload, ctx) {
|
|
98316
98615
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98317
98616
|
if (denied) return denied;
|
|
98318
|
-
const p3 =
|
|
98617
|
+
const p3 = asRecord(payload);
|
|
98319
98618
|
try {
|
|
98320
98619
|
const formAnswers = p3.formAnswers && typeof p3.formAnswers === "object" && !Array.isArray(p3.formAnswers) ? p3.formAnswers : p3.options && typeof p3.options === "object" && !Array.isArray(p3.options) ? p3.options.formAnswers ?? p3.options : void 0;
|
|
98321
98620
|
ctx.sessions.respondPermission({
|
|
@@ -98338,7 +98637,7 @@ function handleSessionRespondPermission(payload, ctx) {
|
|
|
98338
98637
|
function handleSessionRespondQuestion(payload, ctx) {
|
|
98339
98638
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98340
98639
|
if (denied) return denied;
|
|
98341
|
-
const p3 =
|
|
98640
|
+
const p3 = asRecord(payload);
|
|
98342
98641
|
try {
|
|
98343
98642
|
ctx.sessions.respondQuestion({
|
|
98344
98643
|
sessionId: String(p3.sessionId ?? ""),
|
|
@@ -98358,7 +98657,7 @@ function handleSessionRespondQuestion(payload, ctx) {
|
|
|
98358
98657
|
async function handleSessionRespondPlan(payload, ctx) {
|
|
98359
98658
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98360
98659
|
if (denied) return denied;
|
|
98361
|
-
const p3 =
|
|
98660
|
+
const p3 = asRecord(payload);
|
|
98362
98661
|
const decision = p3.decision === "approve" || p3.decision === "reject" ? p3.decision : null;
|
|
98363
98662
|
if (!decision) {
|
|
98364
98663
|
return { error: { code: "invalid_argument", message: "decision must be approve|reject" } };
|
|
@@ -98381,7 +98680,7 @@ async function handleSessionRespondPlan(payload, ctx) {
|
|
|
98381
98680
|
async function handleSessionHostActionsPoll(payload, ctx) {
|
|
98382
98681
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98383
98682
|
if (denied) return denied;
|
|
98384
|
-
const p3 =
|
|
98683
|
+
const p3 = asRecord(payload);
|
|
98385
98684
|
try {
|
|
98386
98685
|
const result2 = await ctx.sessions.pollHostActions({
|
|
98387
98686
|
controllerClientSessionId: ctx.client.clientSessionId,
|
|
@@ -98397,7 +98696,7 @@ async function handleSessionHostActionsPoll(payload, ctx) {
|
|
|
98397
98696
|
function handleSessionClaimHostAction(payload, ctx) {
|
|
98398
98697
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98399
98698
|
if (denied) return denied;
|
|
98400
|
-
const p3 =
|
|
98699
|
+
const p3 = asRecord(payload);
|
|
98401
98700
|
try {
|
|
98402
98701
|
const result2 = ctx.sessions.claimHostAction({
|
|
98403
98702
|
actionId: String(p3.actionId ?? ""),
|
|
@@ -98413,7 +98712,7 @@ function handleSessionClaimHostAction(payload, ctx) {
|
|
|
98413
98712
|
function handleSessionRenewHostActionClaim(payload, ctx) {
|
|
98414
98713
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98415
98714
|
if (denied) return denied;
|
|
98416
|
-
const p3 =
|
|
98715
|
+
const p3 = asRecord(payload);
|
|
98417
98716
|
try {
|
|
98418
98717
|
const result2 = ctx.sessions.renewHostActionClaim({
|
|
98419
98718
|
actionId: String(p3.actionId ?? ""),
|
|
@@ -98429,7 +98728,7 @@ function handleSessionRenewHostActionClaim(payload, ctx) {
|
|
|
98429
98728
|
function handleSessionRespondHostAction(payload, ctx) {
|
|
98430
98729
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98431
98730
|
if (denied) return denied;
|
|
98432
|
-
const p3 =
|
|
98731
|
+
const p3 = asRecord(payload);
|
|
98433
98732
|
const outcome = p3.outcome === "failed" ? "failed" : p3.outcome === "succeeded" ? "succeeded" : null;
|
|
98434
98733
|
if (!outcome) {
|
|
98435
98734
|
return { error: { code: "invalid_argument", message: "outcome must be succeeded|failed" } };
|
|
@@ -98452,7 +98751,7 @@ var MAX_NOTIFIED_PATHS = 32;
|
|
|
98452
98751
|
async function handleSessionNotifyArtifactCompleted(payload, ctx) {
|
|
98453
98752
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98454
98753
|
if (denied) return denied;
|
|
98455
|
-
const p3 =
|
|
98754
|
+
const p3 = asRecord(payload);
|
|
98456
98755
|
const sessionId = String(p3.sessionId ?? "");
|
|
98457
98756
|
const notificationId = String(p3.notificationId ?? "");
|
|
98458
98757
|
const relativePaths = Array.isArray(p3.relativePaths) ? p3.relativePaths.filter((entry2) => typeof entry2 === "string" && entry2.length > 0) : [];
|
|
@@ -98509,7 +98808,7 @@ function streamFilter(p3) {
|
|
|
98509
98808
|
function handleSessionEvents(payload, ctx) {
|
|
98510
98809
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
|
|
98511
98810
|
if (denied) return denied;
|
|
98512
|
-
const p3 =
|
|
98811
|
+
const p3 = asRecord(payload);
|
|
98513
98812
|
const after = String(p3.afterSequence ?? "0");
|
|
98514
98813
|
const events = ctx.sessions.listEventsAfter(after, ctx.client).filter(streamFilterMatcher(streamFilter(p3)));
|
|
98515
98814
|
return { result: { events } };
|
|
@@ -98517,7 +98816,7 @@ function handleSessionEvents(payload, ctx) {
|
|
|
98517
98816
|
function handleSessionMessagesList(payload, ctx) {
|
|
98518
98817
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.readSession);
|
|
98519
98818
|
if (denied) return denied;
|
|
98520
|
-
const p3 =
|
|
98819
|
+
const p3 = asRecord(payload);
|
|
98521
98820
|
const sessionId = String(p3.sessionId ?? "").trim();
|
|
98522
98821
|
if (!sessionId) {
|
|
98523
98822
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -98556,7 +98855,7 @@ function handleCollaborationListProfiles(ctx) {
|
|
|
98556
98855
|
async function handleCollaborationRequest(payload, ctx) {
|
|
98557
98856
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98558
98857
|
if (denied) return denied;
|
|
98559
|
-
const p3 =
|
|
98858
|
+
const p3 = asRecord(payload);
|
|
98560
98859
|
const parentSessionId = String(p3.parentSessionId ?? "");
|
|
98561
98860
|
if (!parentSessionId) {
|
|
98562
98861
|
return { error: { code: "invalid_argument", message: "parentSessionId required" } };
|
|
@@ -98590,7 +98889,7 @@ async function handleCollaborationRequest(payload, ctx) {
|
|
|
98590
98889
|
async function handleCollaborationStart(payload, ctx) {
|
|
98591
98890
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98592
98891
|
if (denied) return denied;
|
|
98593
|
-
const p3 =
|
|
98892
|
+
const p3 = asRecord(payload);
|
|
98594
98893
|
const launchId = typeof p3.launchId === "string" ? p3.launchId.trim() : "";
|
|
98595
98894
|
if (!launchId) {
|
|
98596
98895
|
return { error: { code: "invalid_argument", message: "launchId required" } };
|
|
@@ -98650,7 +98949,7 @@ function assertMailboxLease(p3, sessionId, ctx) {
|
|
|
98650
98949
|
function handleCollaborationSend(payload, ctx) {
|
|
98651
98950
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98652
98951
|
if (denied) return denied;
|
|
98653
|
-
const p3 =
|
|
98952
|
+
const p3 = asRecord(payload);
|
|
98654
98953
|
const sessionId = String(p3.sessionId ?? p3.fromSessionId ?? "");
|
|
98655
98954
|
const content = typeof p3.content === "string" ? p3.content : p3.body !== void 0 ? typeof p3.body === "string" ? p3.body : JSON.stringify(p3.body) : "";
|
|
98656
98955
|
if (!sessionId) {
|
|
@@ -98674,7 +98973,7 @@ function handleCollaborationSend(payload, ctx) {
|
|
|
98674
98973
|
function handleCollaborationRetrieve(payload, ctx) {
|
|
98675
98974
|
const denied = requireScopes(ctx.client, OPERATION_SCOPES.operateSession);
|
|
98676
98975
|
if (denied) return denied;
|
|
98677
|
-
const p3 =
|
|
98976
|
+
const p3 = asRecord(payload);
|
|
98678
98977
|
const sessionId = String(p3.sessionId ?? "");
|
|
98679
98978
|
if (!sessionId) {
|
|
98680
98979
|
return { error: { code: "invalid_argument", message: "sessionId required" } };
|
|
@@ -106084,7 +106383,7 @@ var ImplementationSchema = BaseMetadataSchema.extend({
|
|
|
106084
106383
|
});
|
|
106085
106384
|
var FormElicitationCapabilitySchema = intersection(object({
|
|
106086
106385
|
applyDefaults: boolean2().optional()
|
|
106087
|
-
}),
|
|
106386
|
+
}), record11(string5(), unknown()));
|
|
106088
106387
|
var ElicitationCapabilitySchema = preprocess((value) => {
|
|
106089
106388
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
106090
106389
|
if (Object.keys(value).length === 0) {
|
|
@@ -106095,7 +106394,7 @@ var ElicitationCapabilitySchema = preprocess((value) => {
|
|
|
106095
106394
|
}, intersection(object({
|
|
106096
106395
|
form: FormElicitationCapabilitySchema.optional(),
|
|
106097
106396
|
url: AssertObjectSchema.optional()
|
|
106098
|
-
}),
|
|
106397
|
+
}), record11(string5(), unknown()).optional()));
|
|
106099
106398
|
var ClientTasksCapabilitySchema = looseObject({
|
|
106100
106399
|
/**
|
|
106101
106400
|
* Present if the client supports listing tasks.
|
|
@@ -106148,7 +106447,7 @@ var ClientCapabilitiesSchema = object({
|
|
|
106148
106447
|
/**
|
|
106149
106448
|
* Experimental, non-standard capabilities that the client supports.
|
|
106150
106449
|
*/
|
|
106151
|
-
experimental:
|
|
106450
|
+
experimental: record11(string5(), AssertObjectSchema).optional(),
|
|
106152
106451
|
/**
|
|
106153
106452
|
* Present if the client supports sampling from an LLM.
|
|
106154
106453
|
*/
|
|
@@ -106183,7 +106482,7 @@ var ClientCapabilitiesSchema = object({
|
|
|
106183
106482
|
/**
|
|
106184
106483
|
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
106185
106484
|
*/
|
|
106186
|
-
extensions:
|
|
106485
|
+
extensions: record11(string5(), AssertObjectSchema).optional()
|
|
106187
106486
|
});
|
|
106188
106487
|
var InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
106189
106488
|
/**
|
|
@@ -106202,7 +106501,7 @@ var ServerCapabilitiesSchema = object({
|
|
|
106202
106501
|
/**
|
|
106203
106502
|
* Experimental, non-standard capabilities that the server supports.
|
|
106204
106503
|
*/
|
|
106205
|
-
experimental:
|
|
106504
|
+
experimental: record11(string5(), AssertObjectSchema).optional(),
|
|
106206
106505
|
/**
|
|
106207
106506
|
* Present if the server supports sending log messages to the client.
|
|
106208
106507
|
*/
|
|
@@ -106249,7 +106548,7 @@ var ServerCapabilitiesSchema = object({
|
|
|
106249
106548
|
/**
|
|
106250
106549
|
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
|
|
106251
106550
|
*/
|
|
106252
|
-
extensions:
|
|
106551
|
+
extensions: record11(string5(), AssertObjectSchema).optional()
|
|
106253
106552
|
});
|
|
106254
106553
|
var InitializeResultSchema = ResultSchema.extend({
|
|
106255
106554
|
/**
|
|
@@ -106387,7 +106686,7 @@ var ResourceContentsSchema = object({
|
|
|
106387
106686
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106388
106687
|
* for notes on _meta usage.
|
|
106389
106688
|
*/
|
|
106390
|
-
_meta:
|
|
106689
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106391
106690
|
});
|
|
106392
106691
|
var TextResourceContentsSchema = ResourceContentsSchema.extend({
|
|
106393
106692
|
/**
|
|
@@ -106581,7 +106880,7 @@ var GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
|
106581
106880
|
/**
|
|
106582
106881
|
* Arguments to use for templating the prompt.
|
|
106583
106882
|
*/
|
|
106584
|
-
arguments:
|
|
106883
|
+
arguments: record11(string5(), string5()).optional()
|
|
106585
106884
|
});
|
|
106586
106885
|
var GetPromptRequestSchema = RequestSchema.extend({
|
|
106587
106886
|
method: literal("prompts/get"),
|
|
@@ -106601,7 +106900,7 @@ var TextContentSchema = object({
|
|
|
106601
106900
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106602
106901
|
* for notes on _meta usage.
|
|
106603
106902
|
*/
|
|
106604
|
-
_meta:
|
|
106903
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106605
106904
|
});
|
|
106606
106905
|
var ImageContentSchema = object({
|
|
106607
106906
|
type: literal("image"),
|
|
@@ -106621,7 +106920,7 @@ var ImageContentSchema = object({
|
|
|
106621
106920
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106622
106921
|
* for notes on _meta usage.
|
|
106623
106922
|
*/
|
|
106624
|
-
_meta:
|
|
106923
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106625
106924
|
});
|
|
106626
106925
|
var AudioContentSchema = object({
|
|
106627
106926
|
type: literal("audio"),
|
|
@@ -106641,7 +106940,7 @@ var AudioContentSchema = object({
|
|
|
106641
106940
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106642
106941
|
* for notes on _meta usage.
|
|
106643
106942
|
*/
|
|
106644
|
-
_meta:
|
|
106943
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106645
106944
|
});
|
|
106646
106945
|
var ToolUseContentSchema = object({
|
|
106647
106946
|
type: literal("tool_use"),
|
|
@@ -106659,12 +106958,12 @@ var ToolUseContentSchema = object({
|
|
|
106659
106958
|
* Arguments to pass to the tool.
|
|
106660
106959
|
* Must conform to the tool's inputSchema.
|
|
106661
106960
|
*/
|
|
106662
|
-
input:
|
|
106961
|
+
input: record11(string5(), unknown()),
|
|
106663
106962
|
/**
|
|
106664
106963
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106665
106964
|
* for notes on _meta usage.
|
|
106666
106965
|
*/
|
|
106667
|
-
_meta:
|
|
106966
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106668
106967
|
});
|
|
106669
106968
|
var EmbeddedResourceSchema = object({
|
|
106670
106969
|
type: literal("resource"),
|
|
@@ -106677,7 +106976,7 @@ var EmbeddedResourceSchema = object({
|
|
|
106677
106976
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106678
106977
|
* for notes on _meta usage.
|
|
106679
106978
|
*/
|
|
106680
|
-
_meta:
|
|
106979
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106681
106980
|
});
|
|
106682
106981
|
var ResourceLinkSchema = ResourceSchema.extend({
|
|
106683
106982
|
type: literal("resource_link")
|
|
@@ -106767,7 +107066,7 @@ var ToolSchema = object({
|
|
|
106767
107066
|
*/
|
|
106768
107067
|
inputSchema: object({
|
|
106769
107068
|
type: literal("object"),
|
|
106770
|
-
properties:
|
|
107069
|
+
properties: record11(string5(), AssertObjectSchema).optional(),
|
|
106771
107070
|
required: array(string5()).optional()
|
|
106772
107071
|
}).catchall(unknown()),
|
|
106773
107072
|
/**
|
|
@@ -106777,7 +107076,7 @@ var ToolSchema = object({
|
|
|
106777
107076
|
*/
|
|
106778
107077
|
outputSchema: object({
|
|
106779
107078
|
type: literal("object"),
|
|
106780
|
-
properties:
|
|
107079
|
+
properties: record11(string5(), AssertObjectSchema).optional(),
|
|
106781
107080
|
required: array(string5()).optional()
|
|
106782
107081
|
}).catchall(unknown()).optional(),
|
|
106783
107082
|
/**
|
|
@@ -106792,7 +107091,7 @@ var ToolSchema = object({
|
|
|
106792
107091
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106793
107092
|
* for notes on _meta usage.
|
|
106794
107093
|
*/
|
|
106795
|
-
_meta:
|
|
107094
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106796
107095
|
});
|
|
106797
107096
|
var ListToolsRequestSchema = PaginatedRequestSchema.extend({
|
|
106798
107097
|
method: literal("tools/list")
|
|
@@ -106813,7 +107112,7 @@ var CallToolResultSchema = ResultSchema.extend({
|
|
|
106813
107112
|
*
|
|
106814
107113
|
* If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
|
|
106815
107114
|
*/
|
|
106816
|
-
structuredContent:
|
|
107115
|
+
structuredContent: record11(string5(), unknown()).optional(),
|
|
106817
107116
|
/**
|
|
106818
107117
|
* Whether the tool call ended in an error.
|
|
106819
107118
|
*
|
|
@@ -106841,7 +107140,7 @@ var CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
|
106841
107140
|
/**
|
|
106842
107141
|
* Arguments to pass to the tool.
|
|
106843
107142
|
*/
|
|
106844
|
-
arguments:
|
|
107143
|
+
arguments: record11(string5(), unknown()).optional()
|
|
106845
107144
|
});
|
|
106846
107145
|
var CallToolRequestSchema = RequestSchema.extend({
|
|
106847
107146
|
method: literal("tools/call"),
|
|
@@ -106943,7 +107242,7 @@ var ToolResultContentSchema = object({
|
|
|
106943
107242
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106944
107243
|
* for notes on _meta usage.
|
|
106945
107244
|
*/
|
|
106946
|
-
_meta:
|
|
107245
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106947
107246
|
});
|
|
106948
107247
|
var SamplingContentSchema = discriminatedUnion("type", [TextContentSchema, ImageContentSchema, AudioContentSchema]);
|
|
106949
107248
|
var SamplingMessageContentBlockSchema = discriminatedUnion("type", [
|
|
@@ -106960,7 +107259,7 @@ var SamplingMessageSchema = object({
|
|
|
106960
107259
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
106961
107260
|
* for notes on _meta usage.
|
|
106962
107261
|
*/
|
|
106963
|
-
_meta:
|
|
107262
|
+
_meta: record11(string5(), unknown()).optional()
|
|
106964
107263
|
});
|
|
106965
107264
|
var CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
106966
107265
|
messages: array(SamplingMessageSchema),
|
|
@@ -107148,7 +107447,7 @@ var ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
|
|
|
107148
107447
|
*/
|
|
107149
107448
|
requestedSchema: object({
|
|
107150
107449
|
type: literal("object"),
|
|
107151
|
-
properties:
|
|
107450
|
+
properties: record11(string5(), PrimitiveSchemaDefinitionSchema),
|
|
107152
107451
|
required: array(string5()).optional()
|
|
107153
107452
|
})
|
|
107154
107453
|
});
|
|
@@ -107200,7 +107499,7 @@ var ElicitResultSchema = ResultSchema.extend({
|
|
|
107200
107499
|
* Per MCP spec, content is "typically omitted" for decline/cancel actions.
|
|
107201
107500
|
* We normalize null to undefined for leniency while maintaining type compatibility.
|
|
107202
107501
|
*/
|
|
107203
|
-
content: preprocess((val) => val === null ? void 0 : val,
|
|
107502
|
+
content: preprocess((val) => val === null ? void 0 : val, record11(string5(), union([string5(), number3(), boolean2(), array(string5())])).optional())
|
|
107204
107503
|
});
|
|
107205
107504
|
var ResourceTemplateReferenceSchema = object({
|
|
107206
107505
|
type: literal("ref/resource"),
|
|
@@ -107235,7 +107534,7 @@ var CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
|
|
|
107235
107534
|
/**
|
|
107236
107535
|
* Previously-resolved variables in a URI template or prompt.
|
|
107237
107536
|
*/
|
|
107238
|
-
arguments:
|
|
107537
|
+
arguments: record11(string5(), string5()).optional()
|
|
107239
107538
|
}).optional()
|
|
107240
107539
|
});
|
|
107241
107540
|
var CompleteRequestSchema = RequestSchema.extend({
|
|
@@ -107283,7 +107582,7 @@ var RootSchema = object({
|
|
|
107283
107582
|
* See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
|
|
107284
107583
|
* for notes on _meta usage.
|
|
107285
107584
|
*/
|
|
107286
|
-
_meta:
|
|
107585
|
+
_meta: record11(string5(), unknown()).optional()
|
|
107287
107586
|
});
|
|
107288
107587
|
var ListRootsRequestSchema = RequestSchema.extend({
|
|
107289
107588
|
method: literal("roots/list"),
|
|
@@ -116791,8 +117090,8 @@ function createHostActionMcpServer(superoneSessionId, requestHostAction, opts) {
|
|
|
116791
117090
|
}
|
|
116792
117091
|
function shortenWidgetShowReply(reply, args, harnessId) {
|
|
116793
117092
|
if (reply.isError || !supportsShortWidgetResult(harnessId)) return reply;
|
|
116794
|
-
const
|
|
116795
|
-
const showArgs = readWidgetShowArgs(
|
|
117093
|
+
const record12 = args && typeof args === "object" && !Array.isArray(args) ? args : {};
|
|
117094
|
+
const showArgs = readWidgetShowArgs(record12);
|
|
116796
117095
|
if (!showArgs.widget_code || showArgs.template) return reply;
|
|
116797
117096
|
return { content: widgetShowShortContent(showArgs) };
|
|
116798
117097
|
}
|