xibecode 1.3.11 → 1.3.15

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.
@@ -0,0 +1,137 @@
1
+ /**
2
+ * ACP (Agent Client Protocol) TypeScript types.
3
+ *
4
+ * Implements JSON-RPC 2.0 line-delimited stdio messages for Zed.
5
+ *
6
+ * @module acp-types
7
+ */
8
+ export interface ACPRequest {
9
+ jsonrpc: "2.0";
10
+ id: number | string;
11
+ method: string;
12
+ params?: unknown;
13
+ }
14
+ export interface ACPResponse {
15
+ jsonrpc: "2.0";
16
+ id: number | string | null;
17
+ result?: unknown;
18
+ error?: ACPError;
19
+ }
20
+ export interface ACPNotification {
21
+ jsonrpc: "2.0";
22
+ method: string;
23
+ params?: unknown;
24
+ }
25
+ export interface ACPError {
26
+ code: number;
27
+ message: string;
28
+ data?: unknown;
29
+ }
30
+ export interface ACPInitializeParams {
31
+ protocolVersion: number;
32
+ clientCapabilities?: unknown;
33
+ clientInfo?: {
34
+ name: string;
35
+ title?: string;
36
+ version: string;
37
+ };
38
+ }
39
+ export interface ACPInitializeResult {
40
+ protocolVersion: number;
41
+ agentCapabilities: ACPAgentCapabilities;
42
+ agentInfo: {
43
+ name: string;
44
+ title?: string;
45
+ version: string;
46
+ };
47
+ authMethods: unknown[];
48
+ }
49
+ export interface ACPAgentCapabilities {
50
+ loadSession?: boolean;
51
+ promptCapabilities?: {
52
+ image?: boolean;
53
+ audio?: boolean;
54
+ embeddedContext?: boolean;
55
+ };
56
+ mcpCapabilities?: {
57
+ http?: boolean;
58
+ sse?: boolean;
59
+ };
60
+ sessionCapabilities?: {
61
+ close?: Record<string, never>;
62
+ };
63
+ }
64
+ export interface ACPSessionNewParams {
65
+ cwd: string;
66
+ mcpServers?: unknown[];
67
+ }
68
+ export interface ACPSessionPromptParams {
69
+ sessionId: string;
70
+ prompt: ACPContentBlock[];
71
+ }
72
+ export type ACPContentBlock = {
73
+ type: "text";
74
+ text: string;
75
+ } | {
76
+ type: "resource_link";
77
+ uri: string;
78
+ name?: string;
79
+ mimeType?: string;
80
+ } | {
81
+ type: "resource";
82
+ resource: {
83
+ uri: string;
84
+ mimeType?: string;
85
+ text?: string;
86
+ };
87
+ } | Record<string, unknown>;
88
+ export interface ACPSessionPromptResult {
89
+ stopReason: "end_turn" | "max_tokens" | "max_turn_requests" | "refusal" | "cancelled";
90
+ }
91
+ export interface ACPSessionUpdateParams {
92
+ sessionId: string;
93
+ update: unknown;
94
+ }
95
+ export interface ACPChatParams {
96
+ message: string;
97
+ workspaceRoot?: string;
98
+ messages?: ACPChatMessage[];
99
+ visibleFiles?: string[];
100
+ conversationId?: string;
101
+ }
102
+ export interface ACPChatMessage {
103
+ role: "user" | "assistant" | "system";
104
+ content: string;
105
+ }
106
+ export interface ACPChatResult {
107
+ content: string;
108
+ conversationId?: string;
109
+ }
110
+ export interface ACPChatDeltaParams {
111
+ content: string;
112
+ done?: boolean;
113
+ conversationId?: string;
114
+ }
115
+ export declare const ACP_ERROR_CODES: {
116
+ readonly PARSE_ERROR: -32700;
117
+ readonly INVALID_REQUEST: -32600;
118
+ readonly METHOD_NOT_FOUND: -32601;
119
+ readonly INVALID_PARAMS: -32602;
120
+ readonly INTERNAL_ERROR: -32603;
121
+ readonly AGENT_NOT_READY: -32000;
122
+ readonly AGENT_ERROR: -32001;
123
+ readonly CANCELLED: -32002;
124
+ };
125
+ export declare const ACP_METHODS: {
126
+ readonly INITIALIZE: "initialize";
127
+ readonly SESSION_NEW: "session/new";
128
+ readonly SESSION_PROMPT: "session/prompt";
129
+ readonly SESSION_CANCEL: "session/cancel";
130
+ readonly SESSION_CLOSE: "session/close";
131
+ readonly SESSION_UPDATE: "session/update";
132
+ readonly CHAT: "agent/chat";
133
+ readonly CHAT_DELTA: "agent/chatDelta";
134
+ readonly SHUTDOWN: "shutdown";
135
+ readonly CANCEL: "agent/cancel";
136
+ };
137
+ //# sourceMappingURL=acp-types.d.ts.map
@@ -0,0 +1 @@
1
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OAAO,CAAC;CACjB;AAID,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC;AAIX,eAAO,MAAM,WAAW;;;;;;;;;;;CAWd,CAAC"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ACP (Agent Client Protocol) TypeScript types.
3
+ *
4
+ * Implements JSON-RPC 2.0 line-delimited stdio messages for Zed.
5
+ *
6
+ * @module acp-types
7
+ */
8
+ // ─── ACP Error Codes ───────────────────────────────────────
9
+ export const ACP_ERROR_CODES = {
10
+ PARSE_ERROR: -32700,
11
+ INVALID_REQUEST: -32600,
12
+ METHOD_NOT_FOUND: -32601,
13
+ INVALID_PARAMS: -32602,
14
+ INTERNAL_ERROR: -32603,
15
+ AGENT_NOT_READY: -32000,
16
+ AGENT_ERROR: -32001,
17
+ CANCELLED: -32002,
18
+ };
19
+ // ─── Method Names ──────────────────────────────────────────
20
+ export const ACP_METHODS = {
21
+ INITIALIZE: "initialize",
22
+ SESSION_NEW: "session/new",
23
+ SESSION_PROMPT: "session/prompt",
24
+ SESSION_CANCEL: "session/cancel",
25
+ SESSION_CLOSE: "session/close",
26
+ SESSION_UPDATE: "session/update",
27
+ CHAT: "agent/chat",
28
+ CHAT_DELTA: "agent/chatDelta",
29
+ SHUTDOWN: "shutdown",
30
+ CANCEL: "agent/cancel",
31
+ };
32
+ //# sourceMappingURL=acp-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-types.js","sourceRoot":"","sources":["../../src/acp/acp-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0HH,8DAA8D;AAE9D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,WAAW,EAAE,CAAC,KAAK;IACnB,eAAe,EAAE,CAAC,KAAK;IACvB,gBAAgB,EAAE,CAAC,KAAK;IACxB,cAAc,EAAE,CAAC,KAAK;IACtB,cAAc,EAAE,CAAC,KAAK;IACtB,eAAe,EAAE,CAAC,KAAK;IACvB,WAAW,EAAE,CAAC,KAAK;IACnB,SAAS,EAAE,CAAC,KAAK;CACT,CAAC;AAEX,8DAA8D;AAE9D,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,aAAa,EAAE,eAAe;IAC9B,cAAc,EAAE,gBAAgB;IAChC,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,iBAAiB;IAC7B,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,cAAc;CACd,CAAC"}
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ import { whatsNewCommand } from './commands/whats-new.js';
16
16
  import { resolveSessionBySandboxId } from './utils/cloud-gateway.js';
17
17
  import { ConfigManager } from './utils/config.js';
18
18
  import { resolveRemoteExecutionConfig } from './utils/remote-execution.js';
19
+ import { startACPServer } from './acp/acp-server.js';
19
20
  import dotenv from 'dotenv';
20
21
  import { createRequire } from 'module';
21
22
  const require = createRequire(import.meta.url);
@@ -94,7 +95,10 @@ program
94
95
  .option('--theme <theme>', 'UI theme to use')
95
96
  .option('--session <id>', 'Resume a specific chat session by id')
96
97
  .option('--plain', 'Disable Ink UI; print line-by-line output (best for copying)', false)
97
- .action(chatCommand);
98
+ .action((options) => {
99
+ process.env.XIBECODE_SANDBOX_MODE = 'local';
100
+ chatCommand(options);
101
+ });
98
102
  const cloudCmd = program
99
103
  .command('cloud')
100
104
  .description('Interactive chat with E2B cloud execution (forces e2b for this process). With sandbox_full, uploads a tarball of your project first.')
@@ -161,6 +165,7 @@ resumeCmd
161
165
  .option('--profile <name>', 'Config profile to use (default: configured default profile)')
162
166
  .option('--all', 'Show sessions from all projects, not just the current directory')
163
167
  .action((sessionId, options) => {
168
+ process.env.XIBECODE_SANDBOX_MODE = 'local';
164
169
  resumeCommand({ session: sessionId, profile: options.profile, all: options.all });
165
170
  });
166
171
  // Configuration
@@ -276,8 +281,17 @@ mcpCmd
276
281
  .command('login')
277
282
  .description('Authenticate with Smithery')
278
283
  .action(() => mcpCommand('login', []));
279
- // Launch chat if no command provided (stay local unless user set a subcommand like `cloud`)
280
- if (!process.argv.slice(2).length) {
284
+ // If --acp is present, boot as a headless JSON-RPC 2.0 server over stdio.
285
+ const acpArgIdx = process.argv.indexOf('--acp');
286
+ if (acpArgIdx >= 2) {
287
+ const profileIdx = process.argv.indexOf('--profile');
288
+ const profile = profileIdx >= 0 && profileIdx + 1 < process.argv.length
289
+ ? process.argv[profileIdx + 1]
290
+ : undefined;
291
+ startACPServer(profile);
292
+ }
293
+ else if (!process.argv.slice(2).length) {
294
+ // Launch chat if no command provided (stay local unless user set a subcommand like `cloud`)
281
295
  process.env.XIBECODE_SANDBOX_MODE = 'local';
282
296
  chatCommand({});
283
297
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CA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IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC,CAAC;IACxE,2GAA2G;IAC3G,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAyMF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;AAqtEhE,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwsB/E"}
1
+ {"version":3,"file":"claude-style-chat.d.ts","sourceRoot":"","sources":["../../src/ui/claude-style-chat.tsx"],"names":[],"mappings":"AAwCA,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC,CAAC;IACxE,2GAA2G;IAC3G,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAyMF,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;AAowEhE,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAmtB/E"}
@@ -264,11 +264,15 @@ function prefixForType(type) {
264
264
  return 'Info';
265
265
  }
266
266
  }
267
- function prefixColorKey(type) {
267
+ function prefixColorKey(type, mode) {
268
268
  switch (type) {
269
269
  case 'user':
270
270
  return 'briefLabelYou';
271
271
  case 'assistant':
272
+ if (mode === 'plan')
273
+ return 'briefLabelPlan';
274
+ if (mode === 'review')
275
+ return 'briefLabelReview';
272
276
  return 'briefLabelClaude';
273
277
  case 'tool':
274
278
  return 'suggestion';
@@ -309,6 +313,7 @@ function XibeCodeChatApp(props) {
309
313
  const [setupSelectedModelIndex, setSetupSelectedModelIndex] = useState(0);
310
314
  const [setupProviderPickerOpen, setSetupProviderPickerOpen] = useState(false);
311
315
  const [setupProviderIndex, setSetupProviderIndex] = useState(0);
316
+ const [setupProvider, setSetupProvider] = useState(null);
312
317
  const CONFIG_MENU = [
313
318
  { label: 'Set Base URL (OpenAI format)', value: 'set_baseurl', description: 'Example: https://api.openai.com/v1' },
314
319
  { label: 'Set API key', value: 'set_apikey', description: 'Bearer token used for /models and chat calls' },
@@ -610,6 +615,7 @@ function XibeCodeChatApp(props) {
610
615
  setSetupSelectedModelIndex(0);
611
616
  setSetupProviderPickerOpen(true);
612
617
  setSetupProviderIndex(0);
618
+ setSetupProvider(null);
613
619
  pushLine({ type: 'info', text: 'Setup started.' });
614
620
  }, [pushLine]);
615
621
  useEffect(() => {
@@ -1004,6 +1010,29 @@ function XibeCodeChatApp(props) {
1004
1010
  }
1005
1011
  return;
1006
1012
  }
1013
+ // Intercept natural language mode-switching commands (e.g., "switch to review mode", "switch to review model", "change to plan mode")
1014
+ const modeSwitchRegex = /^(?:please\s+)?(?:switch|change|go|use|activate|turn\s+on)\s+(?:to\s+(?:the\s+)?|mode\s+to\s+)?(agent|plan|review|debugger|tester|security|pentest|team_leader|seo|product|architect|engineer|data|researcher)\s*(?:mode|model|persona)?(?:\s+please)?[\s.!?]*$/i;
1015
+ const matchMode = resolvedInput.match(modeSwitchRegex);
1016
+ if (matchMode) {
1017
+ const modeArg = matchMode[1].toLowerCase();
1018
+ const selectedMode = props.modeOptions.find((mode) => mode.id === modeArg);
1019
+ if (selectedMode) {
1020
+ try {
1021
+ await applyMode(selectedMode.id);
1022
+ }
1023
+ catch (error) {
1024
+ const message = error instanceof Error ? error.message : 'Failed to switch mode';
1025
+ pushLine({ type: 'error', text: message });
1026
+ }
1027
+ }
1028
+ else {
1029
+ pushLine({
1030
+ type: 'error',
1031
+ text: `Mode "${modeArg}" is not enabled. Enabled modes are: ${props.modeOptions.map(m => m.id).join(', ')}.`,
1032
+ });
1033
+ }
1034
+ return;
1035
+ }
1007
1036
  if (resolvedInput === '/mode' || resolvedInput.startsWith('/mode ')) {
1008
1037
  const modeArg = resolvedInput.replace('/mode', '').trim().toLowerCase();
1009
1038
  if (!modeArg) {
@@ -1466,6 +1495,7 @@ function XibeCodeChatApp(props) {
1466
1495
  return;
1467
1496
  const config = new ConfigManager(props.profile);
1468
1497
  setSetupProviderPickerOpen(false);
1498
+ setSetupProvider(picked.value);
1469
1499
  if (picked.value === 'custom') {
1470
1500
  setSetupStep('baseUrl');
1471
1501
  pushLine({
@@ -1690,8 +1720,8 @@ function XibeCodeChatApp(props) {
1690
1720
  ? 'Anthropic Messages'
1691
1721
  : 'OpenAI chat', ")"] })] })] })] }), _jsxs(Box, { marginTop: 1, children: [_jsxs(Text, { color: "suggestion", children: [props.runtimeStatus, ":"] }), _jsx(Text, { color: "inactive", children: " Ready - type " }), _jsx(Text, { color: "claude", children: "/help" }), _jsx(Text, { color: "inactive", children: " to begin" })] }), props.sandboxLabel ? (_jsxs(Text, { color: "inactive", children: ["sandbox: ", props.sandboxLabel] })) : null, props.sandboxId ? (_jsxs(Text, { color: "inactive", children: ["sandbox id: ", props.sandboxId] })) : null, props.previewUrl ? (_jsxs(Text, { color: "inactive", children: ["preview: ", props.previewUrl] })) : null, props.pullHint ? (_jsxs(Text, { color: "inactive", children: ["pull: ", props.pullHint] })) : null, _jsxs(Text, { color: "inactive", children: ["xibecode ", _jsxs(Text, { color: "claude", children: ["v", APP_VERSION] })] }), _jsx(Text, { color: "subtle", children: '─'.repeat(98) }), _jsx(Text, { color: "inactive", children: "Agent transcript" })] }, item.id));
1692
1722
  }
1693
- return (_jsx(React.Fragment, { children: item.type === 'assistant' ? (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { bold: true, color: prefixColorKey('assistant'), children: [prefixForType('assistant'), ":"] }), _jsx(Box, { marginLeft: 2, flexDirection: "column", children: _jsx(AssistantMarkdown, { content: item.text }) })] })) : (_jsxs(Text, { children: [_jsxs(Text, { bold: true, color: prefixColorKey(item.type), children: [prefixForType(item.type), ":", ' '] }), _jsx(Text, { color: lineColorKey(item.type), children: item.text })] })) }, item.id));
1694
- } }), !hasChatContent && (_jsx(Box, { marginTop: 1, flexDirection: "column", children: _jsx(Text, { color: "inactive", children: "(send a message to start)" }) })), _jsx(Text, { color: "subtle", children: divider }), isRunning && (_jsx(Box, { marginTop: 1, paddingX: 1, borderStyle: "round", borderColor: "claudeBlue_FOR_SYSTEM_SPINNER", flexDirection: "column", children: _jsxs(Text, { wrap: "wrap", children: [_jsxs(Text, { bold: true, color: "claudeBlue_FOR_SYSTEM_SPINNER", children: [WORK_SPINNER_FRAMES[workSpinnerFrame], ' '] }), _jsx(Text, { bold: true, color: "briefLabelClaude", children: workVerbPhrase })] }) })), questionsState && (() => {
1723
+ return (_jsx(React.Fragment, { children: item.type === 'assistant' ? (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: [prefixForType('assistant'), ":"] }), _jsx(Box, { marginLeft: 2, flexDirection: "column", children: _jsx(AssistantMarkdown, { content: item.text }) })] })) : (_jsxs(Text, { children: [_jsxs(Text, { bold: true, color: prefixColorKey(item.type, activeMode), children: [prefixForType(item.type), ":", ' '] }), _jsx(Text, { color: lineColorKey(item.type), children: item.text })] })) }, item.id));
1724
+ } }), !hasChatContent && (_jsx(Box, { marginTop: 1, flexDirection: "column", children: _jsx(Text, { color: "inactive", children: "(send a message to start)" }) })), _jsx(Text, { color: "subtle", children: divider }), isRunning && (_jsx(Box, { marginTop: 1, paddingX: 1, borderStyle: "round", borderColor: "claudeBlue_FOR_SYSTEM_SPINNER", flexDirection: "column", children: _jsxs(Text, { wrap: "wrap", children: [_jsxs(Text, { bold: true, color: "claudeBlue_FOR_SYSTEM_SPINNER", children: [WORK_SPINNER_FRAMES[workSpinnerFrame], ' '] }), _jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: workVerbPhrase })] }) })), questionsState && (() => {
1695
1725
  const { questions, currentIndex, selectedOptionIndex, isTypingCustom } = questionsState;
1696
1726
  const q = questions[currentIndex];
1697
1727
  const optLetters = 'abcdefghij';
@@ -1707,23 +1737,36 @@ function XibeCodeChatApp(props) {
1707
1737
  const isSelected = otherIdx === selectedOptionIndex;
1708
1738
  return (_jsxs(Text, { children: [_jsx(Text, { bold: true, color: isSelected ? 'green' : 'inactive', children: isSelected ? ' ▸ ' : ' ' }), _jsxs(Text, { bold: true, color: isSelected ? 'green' : 'yellow', children: [optLetters[otherIdx], ")"] }), _jsx(Text, { color: isSelected ? 'green' : 'inactive', children: " type yourself" })] }));
1709
1739
  })()] }), _jsx(Text, { color: "inactive", dimColor: true, children: "\u2191/\u2193 to navigate, Enter to select, Esc to cancel" })] }));
1710
- })(), _jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: questionsState ? (questionsState.isTypingCustom ? 'green' : 'yellow') : 'claude', paddingX: 1, children: [_jsx(Text, { color: questionsState ? (questionsState.isTypingCustom ? 'green' : 'yellow') : 'claude', children: '> ' }), _jsx(TextInput, { value: input, onChange: handleChatInputChange, onSubmit: onSubmit, placeholder: questionsState
1740
+ })(), _jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: questionsState ? (questionsState.isTypingCustom ? 'green' : 'yellow') : prefixColorKey('assistant', activeMode), paddingX: 1, children: [_jsx(Text, { color: questionsState ? (questionsState.isTypingCustom ? 'green' : 'yellow') : prefixColorKey('assistant', activeMode), children: '> ' }), _jsx(TextInput, { value: input, onChange: handleChatInputChange, onSubmit: onSubmit, placeholder: questionsState
1711
1741
  ? questionsState.isTypingCustom
1712
1742
  ? `Type your answer for Q${questionsState.currentIndex + 1} and press Enter`
1713
1743
  : `Use ↑/↓ and Enter to pick an option (Q${questionsState.currentIndex + 1}/${questionsState.questions.length})`
1714
- : isRunning ? 'Waiting for response…' : 'Message XibeCode…' }, chatInputMountKey)] }), filePickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "suggestion", flexDirection: "column", paddingX: 1, children: [_jsxs(Text, { bold: true, color: "suggestion", children: ["Files", filePickerLoading ? ' (loading...)' : ''] }), filePickerLoading ? (_jsx(Text, { color: "inactive", children: "Scanning workspace\u2026" })) : filteredFileEntries.length === 0 ? (_jsx(Text, { color: "inactive", children: fileQuery ? `No files match "${fileQuery}"` : 'No files in workspace' })) : (visibleFileEntries.map((entry, index) => {
1744
+ : (setupStep === 'apiKey' || configPrompt.kind === 'apiKey')
1745
+ ? 'Enter the API key'
1746
+ : isRunning ? 'Waiting for response…' : 'Message XibeCode…' }, chatInputMountKey)] }), ((setupStep === 'apiKey' && !setupProviderPickerOpen) || configPrompt.kind === 'apiKey') && (() => {
1747
+ const activeSetupProvider = setupStep === 'apiKey'
1748
+ ? (setupProvider || new ConfigManager(props.profile).get('provider'))
1749
+ : new ConfigManager(props.profile).get('provider');
1750
+ const configVal = activeSetupProvider && activeSetupProvider !== 'custom'
1751
+ ? PROVIDER_CONFIGS[activeSetupProvider]
1752
+ : null;
1753
+ const apiKeyUrl = configVal?.apiKeyUrl;
1754
+ if (!apiKeyUrl)
1755
+ return null;
1756
+ return (_jsxs(Box, { marginTop: 1, marginLeft: 1, children: [_jsx(Text, { color: "cyan", underline: true, children: `\u001b]8;;${apiKeyUrl}\u001b\\get api key here\u001b]8;;\u001b\\` }), _jsx(Text, { color: "inactive", children: " (Ctrl+Click / Cmd+Click to open link)" })] }));
1757
+ })(), filePickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsxs(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: ["Files", filePickerLoading ? ' (loading...)' : ''] }), filePickerLoading ? (_jsx(Text, { color: "inactive", children: "Scanning workspace\u2026" })) : filteredFileEntries.length === 0 ? (_jsx(Text, { color: "inactive", children: fileQuery ? `No files match "${fileQuery}"` : 'No files in workspace' })) : (visibleFileEntries.map((entry, index) => {
1715
1758
  const absoluteIndex = filePickerStart + index;
1716
1759
  const isSelected = absoluteIndex === selectedFileIndex;
1717
- return (_jsxs(Text, { children: [_jsx(Text, { color: isSelected ? 'claude' : 'inactive', children: isSelected ? '▸ ' : ' ' }), _jsx(Text, { color: isSelected ? 'claude' : (entry.isDirectory ? 'yellow' : 'text'), children: mentionPathForPick(entry) })] }, entry.relativePath));
1718
- })), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter inserts locked \u27E6@path\u27E7 \u2022 Space ends mention \u2022 Esc close" })] })), isSlashMode && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "suggestion", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { color: "suggestion", bold: true, children: "Commands" }), filteredCommands.length === 0 ? (_jsxs(Text, { color: "inactive", children: ["No commands match \"", input, "\""] })) : (filteredCommands.map((command, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === selectedCommandIndex ? 'claude' : 'inactive', children: index === selectedCommandIndex ? '▸ ' : ' ' }), _jsx(Text, { bold: true, color: index === selectedCommandIndex ? 'claude' : 'text', children: command.name }), _jsxs(Text, { color: "inactive", children: [" \u2014 ", command.description] })] }) }, command.name)))), _jsx(Text, { color: "subtle", children: "Use \u2191/\u2193 to navigate, Tab to autocomplete." })] })), modelPickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "claude", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: "claude", children: "Select model" }), isModelListLoading ? (_jsx(Text, { color: "inactive", children: "Loading models from provider..." })) : filteredModels.length === 0 ? (_jsx(Text, { color: "inactive", children: "No models matched current filter." })) : (visibleModelOptions.map((modelName, index) => {
1760
+ return (_jsxs(Text, { children: [_jsx(Text, { color: isSelected ? prefixColorKey('assistant', activeMode) : 'inactive', children: isSelected ? '▸ ' : ' ' }), _jsx(Text, { color: isSelected ? prefixColorKey('assistant', activeMode) : (entry.isDirectory ? 'yellow' : 'text'), children: mentionPathForPick(entry) })] }, entry.relativePath));
1761
+ })), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter inserts locked \u27E6@path\u27E7 \u2022 Space ends mention \u2022 Esc close" })] })), isSlashMode && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { color: prefixColorKey('assistant', activeMode), bold: true, children: "Commands" }), filteredCommands.length === 0 ? (_jsxs(Text, { color: "inactive", children: ["No commands match \"", input, "\""] })) : (filteredCommands.map((command, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === selectedCommandIndex ? prefixColorKey('assistant', activeMode) : 'inactive', children: index === selectedCommandIndex ? '▸ ' : ' ' }), _jsx(Text, { bold: true, color: index === selectedCommandIndex ? prefixColorKey('assistant', activeMode) : 'text', children: command.name }), _jsxs(Text, { color: "inactive", children: [" \u2014 ", command.description] })] }) }, command.name)))), _jsx(Text, { color: "subtle", children: "Use \u2191/\u2193 to navigate, Tab to autocomplete." })] })), modelPickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: "Select model" }), isModelListLoading ? (_jsx(Text, { color: "inactive", children: "Loading models from provider..." })) : filteredModels.length === 0 ? (_jsx(Text, { color: "inactive", children: "No models matched current filter." })) : (visibleModelOptions.map((modelName, index) => {
1719
1762
  const absoluteIndex = modelPickerStart + index;
1720
1763
  const isSelected = absoluteIndex === selectedModelIndex;
1721
- return (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: isSelected ? 'claude' : 'inactive', children: isSelected ? '▸ ' : ' ' }), _jsx(Text, { color: isSelected ? 'claude' : 'text', children: modelName })] }) }, modelName));
1722
- })), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] })), setupModelPickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "claude", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: "claude", children: "Setup: select model" }), setupModels.length === 0 ? (_jsx(Text, { color: "inactive", children: "No models loaded." })) : (visibleSetupModelOptions.map((modelName, index) => {
1764
+ return (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: isSelected ? prefixColorKey('assistant', activeMode) : 'inactive', children: isSelected ? '▸ ' : ' ' }), _jsx(Text, { color: isSelected ? prefixColorKey('assistant', activeMode) : 'text', children: modelName })] }) }, modelName));
1765
+ })), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] })), setupModelPickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: "Setup: select model" }), setupModels.length === 0 ? (_jsx(Text, { color: "inactive", children: "No models loaded." })) : (visibleSetupModelOptions.map((modelName, index) => {
1723
1766
  const absoluteIndex = setupModelPickerStart + index;
1724
1767
  const isSelected = absoluteIndex === setupSelectedModelIndex;
1725
- return (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: isSelected ? 'claude' : 'inactive', children: isSelected ? '▸ ' : ' ' }), _jsx(Text, { color: isSelected ? 'claude' : 'text', children: modelName })] }) }, modelName));
1726
- })), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc cancel" })] })), (setupStep !== 'idle' || setupProviderPickerOpen) && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "suggestion", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: "suggestion", children: "Setup wizard" }), _jsxs(Text, { wrap: "wrap", children: [_jsx(Text, { color: "claude", bold: true, children: "You are configuring your provider connection." }), _jsxs(Text, { color: "inactive", children: [' ', "This is required before the agent can run."] })] }), setupProviderPickerOpen && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: "inactive", children: "Pick a provider preset (\u2191/\u2193, Enter). Esc cancels." }), [
1768
+ return (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: isSelected ? prefixColorKey('assistant', activeMode) : 'inactive', children: isSelected ? '▸ ' : ' ' }), _jsx(Text, { color: isSelected ? prefixColorKey('assistant', activeMode) : 'text', children: modelName })] }) }, modelName));
1769
+ })), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc cancel" })] })), (setupStep !== 'idle' || setupProviderPickerOpen) && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: "Setup wizard" }), _jsxs(Text, { wrap: "wrap", children: [_jsx(Text, { color: prefixColorKey('assistant', activeMode), bold: true, children: "You are configuring your provider connection." }), _jsxs(Text, { color: "inactive", children: [' ', "This is required before the agent can run."] })] }), setupProviderPickerOpen && (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: "inactive", children: "Pick a provider preset (\u2191/\u2193, Enter). Esc cancels." }), [
1727
1770
  'Routing.run (recommended) (cheapest opensource model provider)',
1728
1771
  'zenllm.org (recommended) (best ai provider with 200+ models)',
1729
1772
  'OpenAI',
@@ -1736,7 +1779,7 @@ function XibeCodeChatApp(props) {
1736
1779
  'Moonshot (Kimi)',
1737
1780
  'Zhipu AI (z.ai)',
1738
1781
  'Custom (paste your own Base URL)',
1739
- ].map((label, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === setupProviderIndex ? 'claude' : 'inactive', children: index === setupProviderIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === setupProviderIndex ? 'claude' : 'text', children: label })] }) }, label)))] })), setupStep === 'baseUrl' && !setupProviderPickerOpen && (_jsx(Text, { color: "inactive", children: "Step: Base URL \u2014 paste an OpenAI-compatible endpoint (example: https://api.openai.com/v1)" })), setupStep === 'apiKey' && !setupProviderPickerOpen && (_jsx(Text, { color: "inactive", children: "Step: API key \u2014 paste your key (stored locally)" })), setupStep === 'loadingModels' && (_jsx(Text, { color: "inactive", children: "Step: Models \u2014 fetching `/models`\u2026" })), setupStep === 'pickModel' && (_jsx(Text, { color: "inactive", children: "Step: Model \u2014 select one below" }))] })), configMenuOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "suggestion", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: "suggestion", children: "Config" }), CONFIG_MENU.map((item, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === configSelectedIndex ? 'claude' : 'inactive', children: index === configSelectedIndex ? '▸ ' : ' ' }), _jsx(Text, { bold: true, color: index === configSelectedIndex ? 'claude' : 'text', children: item.label }), _jsxs(Text, { color: "inactive", children: [" \u2014 ", item.description] })] }) }, item.value))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter select \u2022 Esc close" })] })), configProviderPickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "suggestion", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: "suggestion", children: "Provider" }), [
1782
+ ].map((label, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === setupProviderIndex ? prefixColorKey('assistant', activeMode) : 'inactive', children: index === setupProviderIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === setupProviderIndex ? prefixColorKey('assistant', activeMode) : 'text', children: label })] }) }, label)))] })), setupStep === 'baseUrl' && !setupProviderPickerOpen && (_jsx(Text, { color: "inactive", children: "Step: Base URL \u2014 paste an OpenAI-compatible endpoint (example: https://api.openai.com/v1)" })), setupStep === 'apiKey' && !setupProviderPickerOpen && (_jsx(Text, { color: "inactive", children: "Step: API key \u2014 paste your key (stored locally)" })), setupStep === 'loadingModels' && (_jsx(Text, { color: "inactive", children: "Step: Models \u2014 fetching `/models`\u2026" })), setupStep === 'pickModel' && (_jsx(Text, { color: "inactive", children: "Step: Model \u2014 select one below" }))] })), configMenuOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: "Config" }), CONFIG_MENU.map((item, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === configSelectedIndex ? prefixColorKey('assistant', activeMode) : 'inactive', children: index === configSelectedIndex ? '▸ ' : ' ' }), _jsx(Text, { bold: true, color: index === configSelectedIndex ? prefixColorKey('assistant', activeMode) : 'text', children: item.label }), _jsxs(Text, { color: "inactive", children: [" \u2014 ", item.description] })] }) }, item.value))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter select \u2022 Esc close" })] })), configProviderPickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: "Provider" }), [
1740
1783
  'auto-detect',
1741
1784
  'openai',
1742
1785
  'anthropic',
@@ -1746,7 +1789,7 @@ function XibeCodeChatApp(props) {
1746
1789
  'grok',
1747
1790
  'kimi',
1748
1791
  'zai',
1749
- ].map((label, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === configProviderIndex ? 'claude' : 'inactive', children: index === configProviderIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === configProviderIndex ? 'claude' : 'text', children: label })] }) }, label))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] })), configCostModePickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "suggestion", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: "suggestion", children: "Cost mode" }), ['normal', 'economy'].map((label, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === configCostModeIndex ? 'claude' : 'inactive', children: index === configCostModeIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === configCostModeIndex ? 'claude' : 'text', children: label })] }) }, label))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] })), modePickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: "suggestion", flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: "suggestion", children: "Select mode" }), filteredModeOptions.length === 0 ? (_jsx(Text, { color: "inactive", children: "No modes matched current filter." })) : (filteredModeOptions.map((mode, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === selectedModeIndex ? 'claude' : 'inactive', children: index === selectedModeIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === selectedModeIndex ? 'claude' : 'text', children: mode.id }), _jsxs(Text, { color: "inactive", children: [" \u2014 ", mode.description] })] }) }, mode.id)))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] }))] }));
1792
+ ].map((label, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === configProviderIndex ? prefixColorKey('assistant', activeMode) : 'inactive', children: index === configProviderIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === configProviderIndex ? prefixColorKey('assistant', activeMode) : 'text', children: label })] }) }, label))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] })), configCostModePickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: "Cost mode" }), ['normal', 'economy'].map((label, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === configCostModeIndex ? prefixColorKey('assistant', activeMode) : 'inactive', children: index === configCostModeIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === configCostModeIndex ? prefixColorKey('assistant', activeMode) : 'text', children: label })] }) }, label))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] })), modePickerOpen && (_jsxs(Box, { marginTop: 1, borderStyle: "round", borderColor: prefixColorKey('assistant', activeMode), flexDirection: "column", paddingX: 1, children: [_jsx(Text, { bold: true, color: prefixColorKey('assistant', activeMode), children: "Select mode" }), filteredModeOptions.length === 0 ? (_jsx(Text, { color: "inactive", children: "No modes matched current filter." })) : (filteredModeOptions.map((mode, index) => (_jsx(React.Fragment, { children: _jsxs(Text, { children: [_jsx(Text, { color: index === selectedModeIndex ? prefixColorKey('assistant', activeMode) : 'inactive', children: index === selectedModeIndex ? '▸ ' : ' ' }), _jsx(Text, { color: index === selectedModeIndex ? prefixColorKey('assistant', activeMode) : 'text', children: mode.id }), _jsxs(Text, { color: "inactive", children: [" \u2014 ", mode.description] })] }) }, mode.id)))), _jsx(Text, { color: "subtle", children: "\u2191/\u2193 navigate \u2022 Enter apply \u2022 Esc close" })] }))] }));
1750
1793
  }
1751
1794
  export async function launchClaudeStyleChat(options) {
1752
1795
  if (options.forceLocalRuntime) {
@@ -1914,6 +1957,7 @@ export async function launchClaudeStyleChat(options) {
1914
1957
  activeAgent.removeAllListeners('event');
1915
1958
  let streamedBuffer = '';
1916
1959
  let streamFlushTimer = null;
1960
+ let didOutputContent = false;
1917
1961
  const flushStreamedBuffer = () => {
1918
1962
  if (streamedBuffer.trim()) {
1919
1963
  onLine({ type: 'assistant', text: streamedBuffer.trim() });
@@ -1937,6 +1981,7 @@ export async function launchClaudeStyleChat(options) {
1937
1981
  });
1938
1982
  break;
1939
1983
  case 'tool_call': {
1984
+ didOutputContent = true;
1940
1985
  // Flush any pending streamed text before showing tool call
1941
1986
  flushStreamedBuffer();
1942
1987
  if (streamFlushTimer) {
@@ -1982,6 +2027,8 @@ export async function launchClaudeStyleChat(options) {
1982
2027
  break;
1983
2028
  }
1984
2029
  case 'stream_text':
2030
+ if (event.data?.text)
2031
+ didOutputContent = true;
1985
2032
  opts?.onVisibleOutput?.();
1986
2033
  streamedBuffer += event.data?.text || '';
1987
2034
  // Accumulate streamed text and flush periodically or when buffer is large.
@@ -2010,6 +2057,8 @@ export async function launchClaudeStyleChat(options) {
2010
2057
  flushStreamedBuffer();
2011
2058
  break;
2012
2059
  case 'response':
2060
+ if (event.data?.text)
2061
+ didOutputContent = true;
2013
2062
  opts?.onVisibleOutput?.();
2014
2063
  onLine({ type: 'assistant', text: event.data?.text || '' });
2015
2064
  break;
@@ -2056,6 +2105,12 @@ export async function launchClaudeStyleChat(options) {
2056
2105
  images: opts?.images,
2057
2106
  signal: opts?.signal,
2058
2107
  });
2108
+ if (!didOutputContent) {
2109
+ onLine({
2110
+ type: 'error',
2111
+ text: 'The model returned an empty response. This often happens if the selected model is incompatible with the system prompt, or the API provider dropped the response due to context length.',
2112
+ });
2113
+ }
2059
2114
  // Write the latest messages to the transcript incrementally.
2060
2115
  // The agent's run() method appends to this.messages; we persist
2061
2116
  // the user prompt and assistant response as separate transcript entries.