@orbit-build/cli 0.7.6 → 0.8.1

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.
Files changed (3) hide show
  1. package/README.md +6 -1
  2. package/dist/index.js +524 -265
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -238894,6 +238894,52 @@ async function readResponseJsonWithinLimit(response, maxBytes, label = "HTTP JSO
238894
238894
  await readResponseTextWithinLimit(response, maxBytes, label)
238895
238895
  );
238896
238896
  }
238897
+ function canonicalizeJson(value, ancestors = /* @__PURE__ */ new Set()) {
238898
+ if (value === null || typeof value === "string" || typeof value === "boolean") {
238899
+ return value;
238900
+ }
238901
+ if (typeof value === "number") {
238902
+ if (!Number.isFinite(value)) {
238903
+ throw new TypeError(
238904
+ "Canonical JSON does not support non-finite numbers."
238905
+ );
238906
+ }
238907
+ return value;
238908
+ }
238909
+ if (typeof value !== "object") {
238910
+ throw new TypeError(
238911
+ `Canonical JSON does not support ${typeof value} values.`
238912
+ );
238913
+ }
238914
+ if (ancestors.has(value)) {
238915
+ throw new TypeError("Canonical JSON does not support cyclic values.");
238916
+ }
238917
+ const nextAncestors = new Set(ancestors);
238918
+ nextAncestors.add(value);
238919
+ if (Array.isArray(value)) {
238920
+ return value.map(
238921
+ (item) => canonicalizeArrayValueWithAncestors(item, nextAncestors)
238922
+ );
238923
+ }
238924
+ const result = {};
238925
+ for (const key of Object.keys(value).sort()) {
238926
+ const item = value[key];
238927
+ if (item === void 0 || typeof item === "function" || typeof item === "symbol") {
238928
+ continue;
238929
+ }
238930
+ result[key] = canonicalizeJson(item, nextAncestors);
238931
+ }
238932
+ return result;
238933
+ }
238934
+ function canonicalizeArrayValueWithAncestors(value, ancestors) {
238935
+ if (value === void 0 || typeof value === "function" || typeof value === "symbol") {
238936
+ return null;
238937
+ }
238938
+ return canonicalizeJson(value, ancestors);
238939
+ }
238940
+ function canonicalJsonStringify(value) {
238941
+ return JSON.stringify(canonicalizeJson(value));
238942
+ }
238897
238943
 
238898
238944
  // src/commands/init.ts
238899
238945
  import picocolors from "picocolors";
@@ -242645,6 +242691,7 @@ var zodToJsonSchema = (schema, options) => {
242645
242691
  };
242646
242692
 
242647
242693
  // ../model-providers/dist/index.js
242694
+ import { createHash as createHash2 } from "crypto";
242648
242695
  import { z as z9 } from "zod";
242649
242696
  import { z as z23 } from "zod";
242650
242697
  import { z as z33 } from "zod";
@@ -242750,6 +242797,10 @@ function resolveModelAdaptation(model) {
242750
242797
  const deepSeekV4 = getDeepSeekV4ModelProfile(model);
242751
242798
  return deepSeekV4 ? { family: "deepseek-v4", requestedModel: model, deepSeekV4 } : { family: "generic", requestedModel: model };
242752
242799
  }
242800
+ function resolveDeepSeekModelProfile(model) {
242801
+ const adaptation = resolveModelAdaptation(model);
242802
+ return adaptation.family === "deepseek-v4" ? adaptation.deepSeekV4 : void 0;
242803
+ }
242753
242804
  function resolveModelThinkingPolicy(model, context) {
242754
242805
  const adaptation = resolveModelAdaptation(model);
242755
242806
  if (adaptation.family === "deepseek-v4") {
@@ -243039,6 +243090,113 @@ function parseRetryAfterMs(value) {
243039
243090
  }
243040
243091
  return void 0;
243041
243092
  }
243093
+ var MAX_PROVIDER_TOOLS = 128;
243094
+ var TOOL_NAME_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
243095
+ function normalizeJsonSchemaSets(value) {
243096
+ if (Array.isArray(value)) {
243097
+ return value.map((item) => normalizeJsonSchemaSets(item));
243098
+ }
243099
+ if (value === null || typeof value !== "object") return value;
243100
+ const result = {};
243101
+ for (const [key, item] of Object.entries(value)) {
243102
+ if (key === "required" && Array.isArray(item) && item.every((entry) => typeof entry === "string")) {
243103
+ result[key] = [...item].sort();
243104
+ } else {
243105
+ result[key] = normalizeJsonSchemaSets(item);
243106
+ }
243107
+ }
243108
+ return result;
243109
+ }
243110
+ function canonicalizeToolDefinitions(tools) {
243111
+ if (tools === void 0) return void 0;
243112
+ if (tools.length > MAX_PROVIDER_TOOLS) {
243113
+ throw new Error(
243114
+ `Provider requests support at most ${MAX_PROVIDER_TOOLS} tools.`
243115
+ );
243116
+ }
243117
+ const seen = /* @__PURE__ */ new Set();
243118
+ const canonical = tools.map((tool) => {
243119
+ if (!TOOL_NAME_PATTERN.test(tool.name)) {
243120
+ throw new Error(
243121
+ `Invalid provider tool name "${tool.name}". Use 1-64 letters, digits, underscores, or hyphens.`
243122
+ );
243123
+ }
243124
+ if (seen.has(tool.name)) {
243125
+ throw new Error(`Duplicate provider tool name "${tool.name}".`);
243126
+ }
243127
+ seen.add(tool.name);
243128
+ const schema = canonicalizeJson(
243129
+ normalizeJsonSchemaSets(
243130
+ tool.inputJsonSchema ?? zodToJsonSchema2(tool.inputSchema)
243131
+ )
243132
+ );
243133
+ if (Array.isArray(schema) || schema === null || typeof schema !== "object") {
243134
+ throw new Error(
243135
+ `Provider tool "${tool.name}" must use an object JSON Schema.`
243136
+ );
243137
+ }
243138
+ return {
243139
+ ...tool,
243140
+ inputJsonSchema: schema
243141
+ };
243142
+ });
243143
+ canonical.sort((left, right) => left.name.localeCompare(right.name, "en"));
243144
+ return canonical;
243145
+ }
243146
+ function toolDefinitionsFingerprint(tools) {
243147
+ const canonical = canonicalizeToolDefinitions(tools) ?? [];
243148
+ const wireCatalog = canonical.map((tool) => ({
243149
+ name: tool.name,
243150
+ description: tool.description,
243151
+ parameters: tool.inputJsonSchema
243152
+ }));
243153
+ return createHash2("sha256").update(canonicalJsonStringify(wireCatalog)).digest("hex");
243154
+ }
243155
+ function canonicalizeModelChatInput(input) {
243156
+ const tools = canonicalizeToolDefinitions(input.tools);
243157
+ return tools === void 0 ? input : { ...input, tools };
243158
+ }
243159
+ function validateDeepSeekUserId(userId) {
243160
+ if (userId === void 0) return;
243161
+ if (userId.length === 0 || userId.length > 512) {
243162
+ throw new Error(
243163
+ "DeepSeek user_id must contain between 1 and 512 characters."
243164
+ );
243165
+ }
243166
+ }
243167
+ var ProviderConnectionPreheater = class {
243168
+ constructor(endpoint, disabled = false, timeoutMs = 1e3) {
243169
+ this.endpoint = endpoint;
243170
+ this.disabled = disabled;
243171
+ this.timeoutMs = timeoutMs;
243172
+ }
243173
+ endpoint;
243174
+ disabled;
243175
+ timeoutMs;
243176
+ initialization;
243177
+ initialize() {
243178
+ if (this.disabled || !this.endpoint || typeof fetch !== "function") {
243179
+ return Promise.resolve();
243180
+ }
243181
+ this.initialization ??= this.preheat();
243182
+ return this.initialization;
243183
+ }
243184
+ async preheat() {
243185
+ const controller = new AbortController();
243186
+ const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
243187
+ timeout.unref?.();
243188
+ try {
243189
+ const response = await fetch(this.endpoint, {
243190
+ method: "HEAD",
243191
+ signal: controller.signal
243192
+ });
243193
+ await response.body?.cancel().catch(() => void 0);
243194
+ } catch {
243195
+ } finally {
243196
+ clearTimeout(timeout);
243197
+ }
243198
+ }
243199
+ };
243042
243200
  var MAX_TOOL_ARGUMENT_CHARS = 4 * 1024 * 1024;
243043
243201
  function parseJsonObjectToolArguments(argumentsText, messages) {
243044
243202
  if (argumentsText.length > MAX_TOOL_ARGUMENT_CHARS) {
@@ -243185,6 +243343,10 @@ var AnthropicCompatibleProvider = class {
243185
243343
  this.apiKey = apiKey;
243186
243344
  this.baseUrl = baseUrl;
243187
243345
  this.options = options;
243346
+ this.connectionPreheater = new ProviderConnectionPreheater(
243347
+ baseUrl,
243348
+ options.disablePreheat
243349
+ );
243188
243350
  if (options.id) {
243189
243351
  this.id = options.id;
243190
243352
  }
@@ -243192,6 +243354,7 @@ var AnthropicCompatibleProvider = class {
243192
243354
  apiKey;
243193
243355
  baseUrl;
243194
243356
  options;
243357
+ connectionPreheater;
243195
243358
  id = "anthropic-compatible";
243196
243359
  type = "anthropic-compatible";
243197
243360
  capabilities = {
@@ -243202,28 +243365,14 @@ var AnthropicCompatibleProvider = class {
243202
243365
  vision: false,
243203
243366
  promptCaching: true
243204
243367
  };
243205
- isDeepSeekDialect() {
243368
+ isConfiguredDeepSeekDialect() {
243206
243369
  return this.options.anthropicDialect === "deepseek";
243207
243370
  }
243208
- async initialize() {
243209
- if (this.options.disablePreheat) return;
243210
- try {
243211
- if (this.baseUrl && typeof fetch === "function") {
243212
- const controller = new AbortController();
243213
- const timeout = setTimeout(() => controller.abort(), 1e3);
243214
- timeout.unref?.();
243215
- try {
243216
- const response = await fetch(this.baseUrl, {
243217
- method: "HEAD",
243218
- signal: controller.signal
243219
- });
243220
- await response.body?.cancel().catch(() => void 0);
243221
- } finally {
243222
- clearTimeout(timeout);
243223
- }
243224
- }
243225
- } catch {
243226
- }
243371
+ isOfficialDeepSeekEndpoint() {
243372
+ return this.isConfiguredDeepSeekDialect() && isOfficialDeepSeekApi(this.baseUrl);
243373
+ }
243374
+ initialize() {
243375
+ return this.connectionPreheater.initialize();
243227
243376
  }
243228
243377
  getDefaultApiKeyEnv() {
243229
243378
  if (this.options.apiKeyEnv) {
@@ -243284,9 +243433,9 @@ var AnthropicCompatibleProvider = class {
243284
243433
  return "low";
243285
243434
  }
243286
243435
  getModelCapabilities(model) {
243287
- if (this.isDeepSeekDialect()) {
243288
- const profile = getDeepSeekV4ModelProfile(model);
243289
- if (!profile || profile.legacyAlias || !profile.officialRequestModel) {
243436
+ const profile = resolveDeepSeekModelProfile(model);
243437
+ if (profile) {
243438
+ if (this.isOfficialDeepSeekEndpoint() && (profile.legacyAlias || !profile.officialRequestModel)) {
243290
243439
  return {
243291
243440
  streaming: true,
243292
243441
  toolCalls: false,
@@ -243332,6 +243481,12 @@ var AnthropicCompatibleProvider = class {
243332
243481
  };
243333
243482
  }
243334
243483
  async *chat(input) {
243484
+ try {
243485
+ input = canonicalizeModelChatInput(input);
243486
+ } catch (error) {
243487
+ yield { type: "error", error: toError(error) };
243488
+ return;
243489
+ }
243335
243490
  if (this.options.totalTimeoutMs) {
243336
243491
  const totalSignal = AbortSignal.timeout(this.options.totalTimeoutMs);
243337
243492
  input = {
@@ -243351,8 +243506,9 @@ var AnthropicCompatibleProvider = class {
243351
243506
  return;
243352
243507
  }
243353
243508
  const capabilities = this.getModelCapabilities(input.model);
243354
- const deepSeekProfile = this.isDeepSeekDialect() ? getDeepSeekV4ModelProfile(input.model) : void 0;
243355
- if (this.isDeepSeekDialect() && (!deepSeekProfile || deepSeekProfile.legacyAlias || !deepSeekProfile.officialRequestModel)) {
243509
+ const deepSeekProfile = resolveDeepSeekModelProfile(input.model);
243510
+ const deepSeekSemantics = deepSeekProfile !== void 0;
243511
+ if (this.isConfiguredDeepSeekDialect() && !deepSeekProfile || this.isOfficialDeepSeekEndpoint() && deepSeekProfile !== void 0 && (deepSeekProfile.legacyAlias || !deepSeekProfile.officialRequestModel)) {
243356
243512
  yield {
243357
243513
  type: "error",
243358
243514
  error: new Error(
@@ -243365,30 +243521,9 @@ var AnthropicCompatibleProvider = class {
243365
243521
  let tools;
243366
243522
  let maxTokens;
243367
243523
  try {
243368
- if (this.isDeepSeekDialect()) {
243369
- if (input.userId && !/^[A-Za-z0-9_-]{1,512}$/.test(input.userId)) {
243370
- throw new Error(
243371
- "DeepSeek userId must contain only letters, digits, underscores, or dashes and be at most 512 characters."
243372
- );
243373
- }
243374
- if ((input.tools?.length ?? 0) > 128) {
243375
- throw new Error("DeepSeek accepts at most 128 tools per request.");
243376
- }
243377
- const toolNames = /* @__PURE__ */ new Set();
243378
- for (const tool of input.tools ?? []) {
243379
- if (!/^[A-Za-z0-9_-]{1,64}$/.test(tool.name)) {
243380
- throw new Error(
243381
- "Invalid DeepSeek tool name. Use 1-64 letters, digits, underscores, or dashes."
243382
- );
243383
- }
243384
- if (toolNames.has(tool.name)) {
243385
- throw new Error(`DeepSeek tool name "${tool.name}" is duplicated.`);
243386
- }
243387
- toolNames.add(tool.name);
243388
- }
243389
- }
243524
+ if (deepSeekSemantics) validateDeepSeekUserId(input.userId);
243390
243525
  for (const message2 of input.messages) {
243391
- if (this.isDeepSeekDialect() && message2.content.some((block2) => block2.type === "image")) {
243526
+ if (deepSeekSemantics && message2.content.some((block2) => block2.type === "image")) {
243392
243527
  throw new Error(
243393
243528
  "The selected DeepSeek model does not accept image input. Switch to a vision-capable model or remove the attachment."
243394
243529
  );
@@ -243424,7 +243559,7 @@ var AnthropicCompatibleProvider = class {
243424
243559
  })) : void 0;
243425
243560
  maxTokens = Math.min(
243426
243561
  normalizeAnthropicMaxTokens(input.maxTokens, 16384),
243427
- this.isDeepSeekDialect() ? DEEPSEEK_V4_MAX_OUTPUT_TOKENS : Number.MAX_SAFE_INTEGER
243562
+ deepSeekSemantics ? DEEPSEEK_V4_MAX_OUTPUT_TOKENS : Number.MAX_SAFE_INTEGER
243428
243563
  );
243429
243564
  } catch (error) {
243430
243565
  yield { type: "error", error: toError(error) };
@@ -243473,7 +243608,7 @@ var AnthropicCompatibleProvider = class {
243473
243608
  }
243474
243609
  const body = {
243475
243610
  ...this.options.extraBody ?? {},
243476
- model: deepSeekProfile?.canonicalModel ?? input.model,
243611
+ model: this.isOfficialDeepSeekEndpoint() && deepSeekProfile ? deepSeekProfile.canonicalModel : input.model,
243477
243612
  messages: anthropicMessages,
243478
243613
  max_tokens: maxTokens,
243479
243614
  system: systemParam,
@@ -243562,12 +243697,15 @@ var AnthropicCompatibleProvider = class {
243562
243697
  this.getEndpointUrl("/v1/messages"),
243563
243698
  {
243564
243699
  method: "POST",
243565
- headers: this.buildJsonHeaders(key),
243700
+ headers: {
243701
+ ...this.buildJsonHeaders(key),
243702
+ Accept: body.stream ? "text/event-stream" : "application/json"
243703
+ },
243566
243704
  body: JSON.stringify(body),
243567
243705
  signal: chatSignal,
243568
243706
  timeout: this.options.requestTimeoutMs
243569
243707
  },
243570
- this.options.maxRetries ?? (this.isDeepSeekDialect() ? 0 : 2)
243708
+ this.options.maxRetries ?? (this.isOfficialDeepSeekEndpoint() ? 0 : 2)
243571
243709
  );
243572
243710
  } catch (error) {
243573
243711
  yield {
@@ -243581,7 +243719,7 @@ var AnthropicCompatibleProvider = class {
243581
243719
  yield {
243582
243720
  type: "error",
243583
243721
  error: providerHttpError(
243584
- this.isDeepSeekDialect() ? "DeepSeek Anthropic" : "Anthropic-compatible",
243722
+ deepSeekSemantics ? "DeepSeek Anthropic" : "Anthropic-compatible",
243585
243723
  response.status,
243586
243724
  errText,
243587
243725
  [key],
@@ -243620,7 +243758,7 @@ var AnthropicCompatibleProvider = class {
243620
243758
  input.thinking?.budgetTokens,
243621
243759
  input.thinking?.effort
243622
243760
  ),
243623
- endpointKind: "official"
243761
+ endpointKind: this.isOfficialDeepSeekEndpoint() ? "official" : "gateway"
243624
243762
  };
243625
243763
  }
243626
243764
  try {
@@ -243757,7 +243895,7 @@ var AnthropicCompatibleProvider = class {
243757
243895
  input.thinking?.budgetTokens,
243758
243896
  input.thinking?.effort
243759
243897
  ),
243760
- endpointKind: "official"
243898
+ endpointKind: this.isOfficialDeepSeekEndpoint() ? "official" : "gateway"
243761
243899
  };
243762
243900
  }
243763
243901
  if (parsed.message?.usage) {
@@ -244656,6 +244794,85 @@ async function* chatWithDeepSeekResponses(input, options) {
244656
244794
  input.abortSignal?.removeEventListener("abort", onAbort);
244657
244795
  }
244658
244796
  }
244797
+ function buildDeepSeekChatMessages(input, isDeepSeekV4) {
244798
+ const messages = [];
244799
+ for (const message2 of input.messages) {
244800
+ const text2 = message2.content.filter((block2) => block2.type === "text").map((block2) => block2.text).join("\n");
244801
+ const images = message2.content.filter((block2) => block2.type === "image");
244802
+ if (images.length > 0 && isDeepSeekV4) {
244803
+ throw new Error(
244804
+ "The selected DeepSeek model does not accept image input. Switch to a vision-capable model or remove the attachment."
244805
+ );
244806
+ }
244807
+ if (message2.role === "tool") {
244808
+ const results = message2.content.filter(
244809
+ (block2) => block2.type === "tool_result"
244810
+ );
244811
+ if (results.length === 0) {
244812
+ throw new Error(
244813
+ "A tool-role message must contain at least one tool result."
244814
+ );
244815
+ }
244816
+ for (const block2 of results) {
244817
+ messages.push({
244818
+ role: "tool",
244819
+ tool_call_id: block2.toolResult.toolCallId,
244820
+ content: block2.toolResult.content || "(no output)"
244821
+ });
244822
+ }
244823
+ continue;
244824
+ }
244825
+ const toolCalls = message2.content.filter((block2) => block2.type === "tool_call").map((block2) => {
244826
+ if (isDeepSeekV4) {
244827
+ validateJsonObjectToolArguments(block2.toolCall.arguments);
244828
+ }
244829
+ return {
244830
+ id: block2.toolCall.id,
244831
+ type: "function",
244832
+ function: {
244833
+ name: block2.toolCall.name,
244834
+ arguments: block2.toolCall.arguments
244835
+ }
244836
+ };
244837
+ });
244838
+ if (toolCalls.length > 0 && message2.role !== "assistant") {
244839
+ throw new Error("Tool-call content is only valid in assistant messages.");
244840
+ }
244841
+ if (message2.role === "assistant") {
244842
+ const reasoning = message2.content.filter((block2) => block2.type === "thinking").map((block2) => block2.text).join("\n");
244843
+ const content = isDeepSeekV4 ? text2 : reasoning ? `<think>
244844
+ ${reasoning}
244845
+ </think>
244846
+ ${text2}` : text2 || null;
244847
+ const assistant = {
244848
+ role: "assistant",
244849
+ content
244850
+ };
244851
+ if (toolCalls.length > 0) {
244852
+ assistant.tool_calls = toolCalls;
244853
+ if (isDeepSeekV4) assistant.reasoning_content = reasoning || "";
244854
+ }
244855
+ messages.push(assistant);
244856
+ continue;
244857
+ }
244858
+ if (message2.role === "user" && images.length > 0) {
244859
+ messages.push({
244860
+ role: "user",
244861
+ content: [
244862
+ ...text2 ? [{ type: "text", text: text2 }] : [],
244863
+ ...images.map((image) => ({
244864
+ type: "image_url",
244865
+ image_url: { url: `data:${image.mediaType};base64,${image.data}` }
244866
+ }))
244867
+ ]
244868
+ });
244869
+ } else {
244870
+ messages.push({ role: message2.role, content: text2 });
244871
+ }
244872
+ }
244873
+ if (input.system) messages.unshift({ role: "system", content: input.system });
244874
+ return messages;
244875
+ }
244659
244876
  var ProviderTokenCountSchema2 = z33.number().int().nonnegative().max(1e9);
244660
244877
  var ProviderCollectionIndexSchema2 = z33.number().int().nonnegative().max(1e6);
244661
244878
  var OpenAIUsageSchema = z33.object({
@@ -244734,8 +244951,6 @@ var OpenAICompletionResponseSchema = z33.object({
244734
244951
  }).passthrough()
244735
244952
  ).max(100)
244736
244953
  });
244737
- var OfficialDeepSeekUserIdSchema = z33.string().min(1).max(512).regex(/^[A-Za-z0-9_-]+$/);
244738
- var OfficialDeepSeekToolNameSchema = z33.string().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/);
244739
244954
  var MAX_STREAM_FRAME_CHARS3 = 4 * 1024 * 1024;
244740
244955
  var MAX_STREAM_TOTAL_CHARS3 = 8 * 1024 * 1024;
244741
244956
  var MAX_STREAM_TOOL_CALLS3 = 1e3;
@@ -244763,29 +244978,6 @@ function validateDeepSeekV4Temperature(value) {
244763
244978
  return value;
244764
244979
  }
244765
244980
  function validateDeepSeekV4RequestInput(input) {
244766
- if (input.userId) {
244767
- const result = OfficialDeepSeekUserIdSchema.safeParse(input.userId);
244768
- if (!result.success) {
244769
- throw new Error(
244770
- "DeepSeek userId must contain only letters, digits, underscores, or dashes and be at most 512 characters."
244771
- );
244772
- }
244773
- }
244774
- if ((input.tools?.length ?? 0) > 128) {
244775
- throw new Error("DeepSeek accepts at most 128 tools per request.");
244776
- }
244777
- const toolNames = /* @__PURE__ */ new Set();
244778
- for (const tool of input.tools ?? []) {
244779
- if (!OfficialDeepSeekToolNameSchema.safeParse(tool.name).success) {
244780
- throw new Error(
244781
- "Invalid DeepSeek tool name. Use 1-64 letters, digits, underscores, or dashes."
244782
- );
244783
- }
244784
- if (toolNames.has(tool.name)) {
244785
- throw new Error(`DeepSeek tool name "${tool.name}" is duplicated.`);
244786
- }
244787
- toolNames.add(tool.name);
244788
- }
244789
244981
  if ((input.stopSequences?.length ?? 0) > 16) {
244790
244982
  throw new Error("DeepSeek accepts at most 16 stop sequences.");
244791
244983
  }
@@ -244797,91 +244989,6 @@ function validateDeepSeekV4RequestInput(input) {
244797
244989
  validateDeepSeekV4Temperature(input.temperature);
244798
244990
  }
244799
244991
  }
244800
- function buildOpenAIRequestMessages(input, isDeepSeekV4) {
244801
- const messages = [];
244802
- for (const message2 of input.messages) {
244803
- const text2 = message2.content.filter((block2) => block2.type === "text").map((block2) => block2.text).join("\n");
244804
- const images = message2.content.filter((block2) => block2.type === "image");
244805
- if (images.length > 0 && isDeepSeekV4) {
244806
- throw new Error(
244807
- "The selected DeepSeek model does not accept image input. Switch to a vision-capable model or remove the attachment."
244808
- );
244809
- }
244810
- if (message2.role === "tool") {
244811
- const toolResults = message2.content.filter(
244812
- (block2) => block2.type === "tool_result"
244813
- );
244814
- if (toolResults.length === 0) {
244815
- throw new Error(
244816
- "A tool-role message must contain at least one tool result."
244817
- );
244818
- }
244819
- for (const block2 of toolResults) {
244820
- messages.push({
244821
- role: "tool",
244822
- tool_call_id: block2.toolResult.toolCallId,
244823
- content: block2.toolResult.content || "(no output)"
244824
- });
244825
- }
244826
- continue;
244827
- }
244828
- const toolCalls = message2.content.filter((block2) => block2.type === "tool_call").map((block2) => {
244829
- if (isDeepSeekV4) {
244830
- validateJsonObjectToolArguments(block2.toolCall.arguments);
244831
- }
244832
- return {
244833
- id: block2.toolCall.id,
244834
- type: "function",
244835
- function: {
244836
- name: block2.toolCall.name,
244837
- arguments: block2.toolCall.arguments
244838
- }
244839
- };
244840
- });
244841
- if (toolCalls.length > 0 && message2.role !== "assistant") {
244842
- throw new Error("Tool-call content is only valid in assistant messages.");
244843
- }
244844
- if (message2.role === "assistant") {
244845
- const reasoningContent = message2.content.filter((block2) => block2.type === "thinking").map((block2) => block2.text).join("\n");
244846
- const content = reasoningContent && !isDeepSeekV4 ? `<think>
244847
- ${reasoningContent}
244848
- </think>
244849
- ${text2}` : text2 || (toolCalls.length > 0 && isDeepSeekV4 ? "" : null);
244850
- const assistantMessage = {
244851
- role: "assistant",
244852
- content
244853
- };
244854
- if (toolCalls.length > 0) {
244855
- assistantMessage.tool_calls = toolCalls;
244856
- if (isDeepSeekV4) {
244857
- assistantMessage.reasoning_content = reasoningContent || "";
244858
- }
244859
- }
244860
- messages.push(assistantMessage);
244861
- continue;
244862
- }
244863
- if (message2.role === "user" && images.length > 0) {
244864
- messages.push({
244865
- role: "user",
244866
- content: [
244867
- ...text2 ? [{ type: "text", text: text2 }] : [],
244868
- ...images.map((image) => ({
244869
- type: "image_url",
244870
- image_url: {
244871
- url: `data:${image.mediaType};base64,${image.data}`
244872
- }
244873
- }))
244874
- ]
244875
- });
244876
- } else {
244877
- messages.push({ role: message2.role, content: text2 });
244878
- }
244879
- }
244880
- if (input.system) {
244881
- messages.unshift({ role: "system", content: input.system });
244882
- }
244883
- return messages;
244884
- }
244885
244992
  var STREAMING_THINK_TAGS = [
244886
244993
  { open: "<think>", close: "</think>" },
244887
244994
  { open: "<thinking>", close: "</thinking>" },
@@ -244988,11 +245095,15 @@ var StreamingThinkParser = class {
244988
245095
  return events;
244989
245096
  }
244990
245097
  };
244991
- var DeepSeekOpenAIProvider = class _DeepSeekOpenAIProvider {
245098
+ var OpenAICompatibleProvider = class _OpenAICompatibleProvider {
244992
245099
  constructor(apiKey, baseUrl = "https://api.deepseek.com", options = {}) {
244993
245100
  this.apiKey = apiKey;
244994
245101
  this.baseUrl = baseUrl;
244995
245102
  this.options = options;
245103
+ this.connectionPreheater = new ProviderConnectionPreheater(
245104
+ baseUrl,
245105
+ options.disablePreheat
245106
+ );
244996
245107
  if (options.id) {
244997
245108
  this.id = options.id;
244998
245109
  }
@@ -245001,8 +245112,9 @@ var DeepSeekOpenAIProvider = class _DeepSeekOpenAIProvider {
245001
245112
  baseUrl;
245002
245113
  options;
245003
245114
  static RESPONSES_CIRCUIT_TTL_MS = 5 * 60 * 1e3;
245115
+ connectionPreheater;
245004
245116
  responsesEndpointCircuit;
245005
- id = "deepseek-openai";
245117
+ id = "openai-compatible";
245006
245118
  type = "openai-compatible";
245007
245119
  capabilities = {
245008
245120
  streaming: true,
@@ -245012,25 +245124,8 @@ var DeepSeekOpenAIProvider = class _DeepSeekOpenAIProvider {
245012
245124
  vision: false,
245013
245125
  promptCaching: true
245014
245126
  };
245015
- async initialize() {
245016
- if (this.options.disablePreheat) return;
245017
- try {
245018
- if (this.baseUrl && typeof fetch === "function") {
245019
- const controller = new AbortController();
245020
- const timeout = setTimeout(() => controller.abort(), 1e3);
245021
- timeout.unref?.();
245022
- try {
245023
- const response = await fetch(this.baseUrl, {
245024
- method: "HEAD",
245025
- signal: controller.signal
245026
- });
245027
- await response.body?.cancel().catch(() => void 0);
245028
- } finally {
245029
- clearTimeout(timeout);
245030
- }
245031
- }
245032
- } catch {
245033
- }
245127
+ initialize() {
245128
+ return this.connectionPreheater.initialize();
245034
245129
  }
245035
245130
  getEndpointUrl(path9) {
245036
245131
  const base = this.baseUrl.endsWith("/") ? this.baseUrl.slice(0, -1) : this.baseUrl;
@@ -245118,6 +245213,13 @@ var DeepSeekOpenAIProvider = class _DeepSeekOpenAIProvider {
245118
245213
  };
245119
245214
  }
245120
245215
  async *chat(input) {
245216
+ try {
245217
+ input = canonicalizeModelChatInput(input);
245218
+ validateDeepSeekUserId(input.userId);
245219
+ } catch (error) {
245220
+ yield { type: "error", error: toError(error) };
245221
+ return;
245222
+ }
245121
245223
  if (this.options.totalTimeoutMs) {
245122
245224
  const totalSignal = AbortSignal.timeout(this.options.totalTimeoutMs);
245123
245225
  input = {
@@ -245172,7 +245274,10 @@ var DeepSeekOpenAIProvider = class _DeepSeekOpenAIProvider {
245172
245274
  };
245173
245275
  yield* chatWithDeepSeekResponses(responsesInput, {
245174
245276
  endpoint: this.getEndpointUrl("/v1/responses"),
245175
- headers: this.buildJsonHeaders(key),
245277
+ headers: {
245278
+ ...this.buildJsonHeaders(key),
245279
+ Accept: "text/event-stream"
245280
+ },
245176
245281
  apiKey: key,
245177
245282
  runtime: this.options,
245178
245283
  profile: deepSeekV4Profile,
@@ -245192,14 +245297,14 @@ var DeepSeekOpenAIProvider = class _DeepSeekOpenAIProvider {
245192
245297
  responsesFallbackStatus = error.status;
245193
245298
  this.responsesEndpointCircuit = {
245194
245299
  status: error.status,
245195
- unavailableUntil: Date.now() + _DeepSeekOpenAIProvider.RESPONSES_CIRCUIT_TTL_MS
245300
+ unavailableUntil: Date.now() + _OpenAICompatibleProvider.RESPONSES_CIRCUIT_TTL_MS
245196
245301
  };
245197
245302
  }
245198
245303
  }
245199
245304
  let openaiMessages;
245200
245305
  let tools;
245201
245306
  try {
245202
- openaiMessages = buildOpenAIRequestMessages(input, isDeepSeekV4);
245307
+ openaiMessages = buildDeepSeekChatMessages(input, isDeepSeekV4);
245203
245308
  tools = input.tools?.map((tool) => ({
245204
245309
  type: "function",
245205
245310
  function: {
@@ -245339,7 +245444,10 @@ ${jsonInstruction}`;
245339
245444
  this.getEndpointUrl("/v1/chat/completions"),
245340
245445
  {
245341
245446
  method: "POST",
245342
- headers: this.buildJsonHeaders(key),
245447
+ headers: {
245448
+ ...this.buildJsonHeaders(key),
245449
+ Accept: body.stream ? "text/event-stream" : "application/json"
245450
+ },
245343
245451
  body: JSON.stringify(body),
245344
245452
  signal: chatSignal,
245345
245453
  timeout: this.options.requestTimeoutMs
@@ -245901,11 +246009,11 @@ var DeepSeekProvider = class {
245901
246009
  id: this.id,
245902
246010
  maxRetries: options.maxRetries ?? 0
245903
246011
  };
245904
- this.chatTransport = new DeepSeekOpenAIProvider(apiKey, baseUrl, {
246012
+ this.chatTransport = new OpenAICompatibleProvider(apiKey, baseUrl, {
245905
246013
  ...common,
245906
246014
  deepSeekApiFormat: "chat-completions"
245907
246015
  });
245908
- this.responsesTransport = new DeepSeekOpenAIProvider(apiKey, baseUrl, {
246016
+ this.responsesTransport = new OpenAICompatibleProvider(apiKey, baseUrl, {
245909
246017
  ...common,
245910
246018
  deepSeekApiFormat: "responses"
245911
246019
  });
@@ -245963,8 +246071,12 @@ var DeepSeekProvider = class {
245963
246071
  }
245964
246072
  chat(input) {
245965
246073
  const format = this.selectFormat(input);
245966
- if (format === "anthropic") return this.anthropicTransport.chat(input);
245967
- if (format === "responses") return this.responsesTransport.chat(input);
246074
+ if (format === "anthropic") {
246075
+ return this.anthropicTransport.chat(input);
246076
+ }
246077
+ if (format === "responses") {
246078
+ return this.responsesTransport.chat(input);
246079
+ }
245968
246080
  return this.chatTransport.chat(input);
245969
246081
  }
245970
246082
  embed(texts, options) {
@@ -245984,7 +246096,7 @@ var DeepSeekProvider = class {
245984
246096
  return baseUrl.endsWith("/anthropic") ? baseUrl : `${baseUrl.replace(/\/$/, "")}/anthropic`;
245985
246097
  }
245986
246098
  };
245987
- var OpenAIProvider = class extends DeepSeekOpenAIProvider {
246099
+ var OpenAIProvider = class extends OpenAICompatibleProvider {
245988
246100
  id = "openai";
245989
246101
  type = "openai";
245990
246102
  constructor(apiKey, baseUrl = "https://api.openai.com/v1", options = {}) {
@@ -246004,7 +246116,7 @@ var AnthropicProvider = class extends AnthropicCompatibleProvider {
246004
246116
  });
246005
246117
  }
246006
246118
  };
246007
- var OllamaProvider = class extends DeepSeekOpenAIProvider {
246119
+ var OllamaProvider = class extends OpenAICompatibleProvider {
246008
246120
  id = "ollama";
246009
246121
  type = "ollama";
246010
246122
  constructor(baseUrl = "http://localhost:11434", options = {}) {
@@ -246030,7 +246142,7 @@ import picocolors4 from "picocolors";
246030
246142
 
246031
246143
  // ../core/dist/index.js
246032
246144
  import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
246033
- import { createHash as createHash6 } from "crypto";
246145
+ import { createHash as createHash7 } from "crypto";
246034
246146
  import { join as join10 } from "path";
246035
246147
  import { z as z31 } from "zod";
246036
246148
  import { z as z211 } from "zod";
@@ -247648,7 +247760,7 @@ var $ = create$();
247648
247760
  import { z as z52 } from "zod";
247649
247761
  import { z as z62 } from "zod";
247650
247762
  import { z as z72 } from "zod";
247651
- import { createHash as createHash2 } from "crypto";
247763
+ import { createHash as createHash3 } from "crypto";
247652
247764
  import { z as z82 } from "zod";
247653
247765
  import { z as z92 } from "zod";
247654
247766
  import { z as z102 } from "zod";
@@ -248805,7 +248917,7 @@ var WriteFileTool = class {
248805
248917
  error: `Cannot verify expectedHash because the file does not exist: ${input.path}`
248806
248918
  };
248807
248919
  }
248808
- const currentHash = createHash2("sha256").update(current).digest("hex");
248920
+ const currentHash = createHash3("sha256").update(current).digest("hex");
248809
248921
  if (currentHash !== input.expectedHash.toLowerCase()) {
248810
248922
  return {
248811
248923
  ok: false,
@@ -251520,7 +251632,7 @@ import { basename, join as join7 } from "path";
251520
251632
  import { existsSync as existsSync43, writeFileSync as writeFileSync4, mkdirSync as mkdirSync3, renameSync as renameSync3, rmSync as rmSync2 } from "fs";
251521
251633
  import { promises as fsPromises3 } from "fs";
251522
251634
  import { join as join24, dirname as dirname32, isAbsolute as isAbsolute3, resolve as resolve32 } from "path";
251523
- import { createHash as createHash3, randomUUID as randomUUID32 } from "crypto";
251635
+ import { createHash as createHash4, randomUUID as randomUUID32 } from "crypto";
251524
251636
  import { execFile as execFile2 } from "child_process";
251525
251637
  import glob3 from "fast-glob";
251526
251638
  import { z as z43 } from "zod";
@@ -252939,7 +253051,7 @@ var EmbeddingCache = class {
252939
253051
  }
252940
253052
  }
252941
253053
  get(text2) {
252942
- const hash2 = createHash3("sha256").update(text2).digest("hex");
253054
+ const hash2 = createHash4("sha256").update(text2).digest("hex");
252943
253055
  const vector = this.cache[hash2];
252944
253056
  if (vector) {
252945
253057
  delete this.cache[hash2];
@@ -252951,7 +253063,7 @@ var EmbeddingCache = class {
252951
253063
  if (vector.length === 0 || vector.length > 32768 || vector.some((value) => !Number.isFinite(value))) {
252952
253064
  return;
252953
253065
  }
252954
- const hash2 = createHash3("sha256").update(text2).digest("hex");
253066
+ const hash2 = createHash4("sha256").update(text2).digest("hex");
252955
253067
  delete this.cache[hash2];
252956
253068
  this.cache[hash2] = vector;
252957
253069
  this.trim();
@@ -254735,7 +254847,7 @@ import { z as z64 } from "zod";
254735
254847
 
254736
254848
  // ../mcp/dist/index.js
254737
254849
  import { spawn as spawn2 } from "child_process";
254738
- import { createHash as createHash4 } from "crypto";
254850
+ import { createHash as createHash5 } from "crypto";
254739
254851
  var import_ajv = __toESM(require_ajv(), 1);
254740
254852
  import { z as z36 } from "zod";
254741
254853
  import { z as z27 } from "zod";
@@ -255763,7 +255875,7 @@ function createMcpToolName(serverName, originalToolName) {
255763
255875
  const rawName = `mcp__${serverName}__${originalToolName}`;
255764
255876
  if (/^[A-Za-z0-9_-]{1,64}$/.test(rawName)) return rawName;
255765
255877
  const normalized = rawName.replace(/[^A-Za-z0-9_-]+/g, "_").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
255766
- const digest = createHash4("sha256").update(rawName).digest("hex").slice(0, 8);
255878
+ const digest = createHash5("sha256").update(rawName).digest("hex").slice(0, 8);
255767
255879
  const prefix = (normalized || "mcp_tool").slice(0, 55).replace(/_+$/g, "");
255768
255880
  return `${prefix}_${digest}`;
255769
255881
  }
@@ -257922,7 +258034,7 @@ function toErrorMessage2(error) {
257922
258034
 
257923
258035
  // ../session/dist/index.js
257924
258036
  import { z as z30 } from "zod";
257925
- import { createHash as createHash5, randomUUID as randomUUID6 } from "crypto";
258037
+ import { createHash as createHash6, randomUUID as randomUUID6 } from "crypto";
257926
258038
  import { dirname as dirname8, isAbsolute as isAbsolute4, join as join9, relative as relative5, resolve as resolve7, sep } from "path";
257927
258039
  import {
257928
258040
  closeSync as closeSync5,
@@ -258681,7 +258793,7 @@ var SessionStore = class {
258681
258793
  schemaVersion: 1,
258682
258794
  exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
258683
258795
  workspace: {
258684
- id: createHash5("sha256").update(this.cwd).digest("hex").slice(0, 16),
258796
+ id: createHash6("sha256").update(this.cwd).digest("hex").slice(0, 16),
258685
258797
  path: "<workspace>"
258686
258798
  },
258687
258799
  session: {
@@ -260271,8 +260383,11 @@ var PromptCacheTelemetrySampleSchema = z31.object({
260271
260383
  });
260272
260384
  var PromptCacheSlabMetadataSchema = z31.object({
260273
260385
  hash: z31.string().max(128).optional(),
260386
+ provider: z31.string().max(1024).optional(),
260274
260387
  model: z31.string().max(1024).optional(),
260275
260388
  tokenEstimate: z31.number().int().nonnegative().optional(),
260389
+ systemHash: z31.string().max(128).optional(),
260390
+ toolSchemaHash: z31.string().max(128).optional(),
260276
260391
  lastPrimedAt: z31.string().max(100).optional(),
260277
260392
  telemetry: z31.array(PromptCacheTelemetrySampleSchema).max(100).optional()
260278
260393
  }).passthrough();
@@ -260288,7 +260403,17 @@ function readPromptCacheSlabMetadata(path9) {
260288
260403
  var PromptCacheSlabBuilder = class {
260289
260404
  static build(input) {
260290
260405
  const stableText = this.buildStableText(input);
260291
- const hash2 = createHash6("sha256").update(stableText).digest("hex");
260406
+ const systemHash = createHash7("sha256").update(stableText).digest("hex");
260407
+ const toolSchemaHash = toolDefinitionsFingerprint(input.tools);
260408
+ const hash2 = createHash7("sha256").update(
260409
+ [
260410
+ "orbit-cache-prefix-v3",
260411
+ input.provider,
260412
+ input.model,
260413
+ systemHash,
260414
+ toolSchemaHash
260415
+ ].join("\n")
260416
+ ).digest("hex");
260292
260417
  const slabPath = join10(
260293
260418
  input.cwd,
260294
260419
  ".orbit",
@@ -260297,6 +260422,9 @@ var PromptCacheSlabBuilder = class {
260297
260422
  );
260298
260423
  return {
260299
260424
  hash: hash2,
260425
+ systemHash,
260426
+ toolSchemaHash,
260427
+ provider: input.provider,
260300
260428
  model: input.model,
260301
260429
  text: stableText,
260302
260430
  tokenEstimate: estimateTokenCount(stableText),
@@ -260344,7 +260472,7 @@ var PromptCacheSlabBuilder = class {
260344
260472
  const recent = samples.at(-1);
260345
260473
  const avgHit = samples.length > 0 ? samples.reduce((sum, item) => sum + item.hitRate, 0) / samples.length : void 0;
260346
260474
  lines.push(
260347
- `- slab ${String(slab.hash).slice(0, 8)} model=${slab.model || "unknown"} tokens=${slab.tokenEstimate || 0} observations=${samples.length}`
260475
+ `- slab ${String(slab.hash).slice(0, 8)} provider=${slab.provider || "legacy"} model=${slab.model || "unknown"} system=${String(slab.systemHash || "unknown").slice(0, 8)} tools=${String(slab.toolSchemaHash || "unknown").slice(0, 8)} tokens=${slab.tokenEstimate || 0} observations=${samples.length}`
260348
260476
  );
260349
260477
  if (recent) {
260350
260478
  lines.push(
@@ -260367,6 +260495,9 @@ var PromptCacheSlabBuilder = class {
260367
260495
  JSON.stringify(
260368
260496
  {
260369
260497
  hash: slab.hash,
260498
+ systemHash: slab.systemHash,
260499
+ toolSchemaHash: slab.toolSchemaHash,
260500
+ provider: slab.provider,
260370
260501
  model: slab.model,
260371
260502
  tokenEstimate: slab.tokenEstimate,
260372
260503
  telemetry: telemetry || existing?.telemetry || []
@@ -260383,7 +260514,10 @@ var PromptCacheSlabBuilder = class {
260383
260514
  const sortedLanguages = [...ctx.projectIndex.detectedLanguages].sort();
260384
260515
  const sortedFrameworks = [...ctx.projectIndex.frameworks].sort();
260385
260516
  const sortedEntrypoints = [...ctx.projectIndex.entrypoints].sort();
260386
- const skillsIndex = (ctx.skillsIndex || []).map((skill) => {
260517
+ const skillsIndex = (ctx.skillsIndex || []).slice().sort((left, right) => {
260518
+ const byName = left.name.localeCompare(right.name, "en");
260519
+ return byName !== 0 ? byName : left.path.localeCompare(right.path, "en");
260520
+ }).map((skill) => {
260387
260521
  const description = skill.description ? ` - ${skill.description.replace(/\s+/g, " ").trim()}` : "";
260388
260522
  return `- ${skill.name}${description}`;
260389
260523
  }).join("\n");
@@ -260402,7 +260536,7 @@ var PromptCacheSlabBuilder = class {
260402
260536
  ${skillsIndex}` : "",
260403
260537
  ctx.projectInstructions ? `
260404
260538
  ### Project Instructions
260405
- ${ctx.projectInstructions}` : ""
260539
+ ${ctx.projectInstructions.replace(/\r\n/g, "\n").replace(/\r/g, "\n")}` : ""
260406
260540
  ].filter(Boolean).join("\n");
260407
260541
  return [
260408
260542
  input.baseSystemPrompt.trimEnd(),
@@ -263709,9 +263843,11 @@ Note: To find where a symbol (class, function, etc.) is declared or referenced,
263709
263843
  const contextPack = this.cachedContextPack;
263710
263844
  const cacheSlab = PromptCacheSlabBuilder.build({
263711
263845
  cwd: this.cwd,
263846
+ provider: this.provider.id,
263712
263847
  model: activeModel2,
263713
263848
  baseSystemPrompt,
263714
263849
  toolsPrompt,
263850
+ tools: toolDefs,
263715
263851
  repoMapText,
263716
263852
  contextPack
263717
263853
  });
@@ -267811,7 +267947,7 @@ function getAutocompleteProvider(providerId, config) {
267811
267947
  if (providerId === "ollama") {
267812
267948
  return new OllamaProvider();
267813
267949
  }
267814
- return new DeepSeekOpenAIProvider(
267950
+ return new OpenAICompatibleProvider(
267815
267951
  process.env.DEEPSEEK_API_KEY || process.env.OPENAI_API_KEY || "no-key"
267816
267952
  );
267817
267953
  }
@@ -267839,7 +267975,7 @@ function getAutocompleteProvider(providerId, config) {
267839
267975
  case "openai-compatible":
267840
267976
  case "anthropic-compatible":
267841
267977
  default:
267842
- return new DeepSeekOpenAIProvider(apiKey, baseUrl, providerOptions);
267978
+ return new OpenAICompatibleProvider(apiKey, baseUrl, providerOptions);
267843
267979
  }
267844
267980
  }
267845
267981
  function safeDecodeURI(uri) {
@@ -268165,7 +268301,7 @@ function buildCacheDiagnostics(cwd) {
268165
268301
  }
268166
268302
 
268167
268303
  // src/runtime/ProviderBenchmarks.ts
268168
- import { createHash as createHash7 } from "crypto";
268304
+ import { createHash as createHash8 } from "crypto";
268169
268305
  import picocolors5 from "picocolors";
268170
268306
  import { z as z39 } from "zod";
268171
268307
  var MAX_PROVIDER_BENCHMARK_BYTES = 2 * 1024 * 1024;
@@ -268199,7 +268335,7 @@ function providerBenchmarkPath(cwd) {
268199
268335
  return resolveSafePath(cwd, ".orbit/provider-benchmarks.json");
268200
268336
  }
268201
268337
  function benchmarkPromptHash(prompt) {
268202
- return createHash7("sha256").update(prompt).digest("hex").slice(0, 16);
268338
+ return createHash8("sha256").update(prompt).digest("hex").slice(0, 16);
268203
268339
  }
268204
268340
  function readProviderBenchmarks(cwd) {
268205
268341
  try {
@@ -268679,7 +268815,7 @@ function createProviderFromConfig(config) {
268679
268815
  modelCapabilities: pConfig.modelCapabilities,
268680
268816
  apiKeyResolver: () => pConfig.apiKey
268681
268817
  };
268682
- if (pConfig.type === "deepseek") {
268818
+ if (pConfig.type === "deepseek" || pConfig.type === "openai-compatible" && isOfficialDeepSeekApi(pConfig.baseUrl)) {
268683
268819
  return new DeepSeekProvider(void 0, pConfig.baseUrl, providerOptions);
268684
268820
  }
268685
268821
  if (pConfig.type === "anthropic-compatible") {
@@ -268690,7 +268826,7 @@ function createProviderFromConfig(config) {
268690
268826
  );
268691
268827
  }
268692
268828
  if (pConfig.type === "openai-compatible") {
268693
- return new DeepSeekOpenAIProvider(
268829
+ return new OpenAICompatibleProvider(
268694
268830
  void 0,
268695
268831
  pConfig.baseUrl,
268696
268832
  providerOptions
@@ -268879,6 +269015,11 @@ function buildDoctorSnapshot(cwd, config = ConfigLoader.loadSync(cwd), options =
268879
269015
  const exec6 = options.exec || defaultExec;
268880
269016
  const defaultProvider = config.provider.default;
268881
269017
  const provider = config.providers[defaultProvider];
269018
+ let effectiveProviderType = provider?.type || null;
269019
+ try {
269020
+ effectiveProviderType = createProviderFromConfig(config).type;
269021
+ } catch {
269022
+ }
268882
269023
  const nodeMajor = Number(process.versions.node.split(".")[0]);
268883
269024
  const gitVersion = commandOutput(exec6, "git --version", cwd)?.replace(
268884
269025
  /^git version\s+/i,
@@ -268993,7 +269134,7 @@ function buildDoctorSnapshot(cwd, config = ConfigLoader.loadSync(cwd), options =
268993
269134
  },
268994
269135
  provider: {
268995
269136
  id: defaultProvider,
268996
- type: provider?.type || null,
269137
+ type: effectiveProviderType,
268997
269138
  baseUrl: sanitizeDiagnosticUrl(provider?.baseUrl),
268998
269139
  apiKeyLoaded: hasApiKey,
268999
269140
  apiKeySource: provider?.apiKeyEnv || "configured provider key",
@@ -269310,7 +269451,7 @@ async function runDoctor(cwd, options = {}) {
269310
269451
 
269311
269452
  // src/commands/bench.ts
269312
269453
  import picocolors7 from "picocolors";
269313
- import { createHash as createHash8, randomUUID as randomUUID8 } from "crypto";
269454
+ import { createHash as createHash9, randomUUID as randomUUID8 } from "crypto";
269314
269455
  import { resolve as resolve8 } from "path";
269315
269456
  import { z as z48 } from "zod";
269316
269457
  var BenchOptionsSchema = z48.object({
@@ -269332,7 +269473,7 @@ var BenchOptionsSchema = z48.object({
269332
269473
  function parseBenchOptions(value) {
269333
269474
  return BenchOptionsSchema.parse(value);
269334
269475
  }
269335
- async function runSingleBench(provider, model, prompt, maxTokens, thinkingMode, userId) {
269476
+ async function runSingleBench(provider, model, prompt, maxTokens, thinkingMode, userId, cacheContinuationRound = 0) {
269336
269477
  const startedAt = Date.now();
269337
269478
  let firstDeltaMs;
269338
269479
  let firstThinkingMs;
@@ -269348,14 +269489,7 @@ async function runSingleBench(provider, model, prompt, maxTokens, thinkingMode,
269348
269489
  try {
269349
269490
  const stream = provider.chat({
269350
269491
  model,
269351
- messages: [
269352
- {
269353
- id: `msg_bench_${Date.now()}`,
269354
- role: "user",
269355
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
269356
- content: [{ type: "text", text: prompt }]
269357
- }
269358
- ],
269492
+ messages: buildCacheProfileMessages(prompt, cacheContinuationRound),
269359
269493
  tools: [],
269360
269494
  stream: true,
269361
269495
  maxTokens,
@@ -269483,6 +269617,39 @@ ${Array.from({ length: 180 }, () => stablePrefix).join("\n")}
269483
269617
 
269484
269618
  ${workload}`;
269485
269619
  }
269620
+ function buildCacheProfileMessages(prompt, continuationRound = 0) {
269621
+ const createdAt = "2026-01-01T00:00:00.000Z";
269622
+ const messages = [
269623
+ {
269624
+ id: "cache-profile-user-0",
269625
+ role: "user",
269626
+ createdAt,
269627
+ content: [{ type: "text", text: prompt }]
269628
+ }
269629
+ ];
269630
+ if (continuationRound > 0) {
269631
+ messages.push(
269632
+ {
269633
+ id: "cache-profile-assistant-0",
269634
+ role: "assistant",
269635
+ createdAt,
269636
+ content: [{ type: "text", text: "ok" }]
269637
+ },
269638
+ {
269639
+ id: `cache-profile-user-${continuationRound}`,
269640
+ role: "user",
269641
+ createdAt,
269642
+ content: [
269643
+ {
269644
+ type: "text",
269645
+ text: `Cache continuation ${continuationRound}. Reply with exactly: ok`
269646
+ }
269647
+ ]
269648
+ }
269649
+ );
269650
+ }
269651
+ return messages;
269652
+ }
269486
269653
  function evaluateCacheProfile(results) {
269487
269654
  const successful = results.filter((item) => !item.error);
269488
269655
  const cold = successful[0];
@@ -269515,7 +269682,7 @@ function formatCacheProfileSummary(results) {
269515
269682
  warmAvgHit * 100
269516
269683
  )}% \xB7 speedup=${profile.speedup}`,
269517
269684
  `Prompt hash: ${cold.promptHash} \xB7 prompt chars=${cold.promptChars}`,
269518
- "Interpretation: the default profile uses a unique prefix per command and repeats it byte-for-byte within the run. Trust returned cacheReadTokens, since provider caching is best-effort."
269685
+ "Interpretation: the profile uses a unique prefix per command, then exercises append-only follow-up requests over the same persisted boundary. Trust returned cacheReadTokens, since provider caching is best-effort."
269519
269686
  ].join("\n");
269520
269687
  }
269521
269688
  function printBenchResult(result, index) {
@@ -269654,7 +269821,7 @@ async function runBench(cwd, options = {}) {
269654
269821
  const results = [];
269655
269822
  const cacheProfileGroups = /* @__PURE__ */ new Map();
269656
269823
  const workspaceIdentity = resolve8(cwd).replace(/\\/g, "/");
269657
- const userId = createHash8("sha256").update(
269824
+ const userId = createHash9("sha256").update(
269658
269825
  process.platform === "win32" ? workspaceIdentity.toLowerCase() : workspaceIdentity
269659
269826
  ).digest("hex");
269660
269827
  for (const model of models) {
@@ -269667,7 +269834,8 @@ async function runBench(cwd, options = {}) {
269667
269834
  prompt,
269668
269835
  maxTokens,
269669
269836
  thinkingMode,
269670
- userId
269837
+ userId,
269838
+ options.cacheProfile ? i2 : 0
269671
269839
  );
269672
269840
  recordProviderBenchmark(cwd, result);
269673
269841
  results.push(result);
@@ -276570,23 +276738,39 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
276570
276738
  elements.projectPathInput.focus();
276571
276739
  elements.projectPathInput.select();
276572
276740
  };
276573
- const switchToProject = (result) => {
276741
+ const reserveProjectTab = () => {
276742
+ const projectTab = window.open('about:blank', '_blank');
276743
+ if (projectTab) projectTab.opener = null;
276744
+ return projectTab;
276745
+ };
276746
+ const closeReservedProjectTab = (projectTab) => {
276747
+ if (projectTab && !projectTab.closed) projectTab.close();
276748
+ };
276749
+ const switchToProject = (result, projectTab) => {
276574
276750
  if (!result || typeof result.url !== 'string') {
276751
+ closeReservedProjectTab(projectTab);
276575
276752
  throw new Error(copy.projectSwitchFailed);
276576
276753
  }
276577
- const target = new URL(result.url);
276578
- const token = new URLSearchParams(target.hash.slice(1)).get('token');
276754
+ const projectUrl = new URL(result.url);
276755
+ const token = new URLSearchParams(projectUrl.hash.slice(1)).get('token');
276579
276756
  if (
276580
- target.protocol !== 'http:' ||
276581
- !['127.0.0.1', '::1', 'localhost'].includes(target.hostname) ||
276582
- target.username ||
276583
- target.password ||
276757
+ projectUrl.protocol !== 'http:' ||
276758
+ !['127.0.0.1', '::1', 'localhost'].includes(projectUrl.hostname) ||
276759
+ projectUrl.username ||
276760
+ projectUrl.password ||
276584
276761
  !token ||
276585
276762
  !/^[A-Za-z0-9_-]{32,128}$/.test(token)
276586
276763
  ) {
276764
+ closeReservedProjectTab(projectTab);
276587
276765
  throw new Error(copy.projectSwitchFailed);
276588
276766
  }
276589
- window.location.assign(target.href);
276767
+ if (projectTab && !projectTab.closed) {
276768
+ projectTab.location.replace(projectUrl.href);
276769
+ projectTab.focus();
276770
+ showToast(copy.projectOpened, 'success');
276771
+ return;
276772
+ }
276773
+ window.location.assign(projectUrl.href);
276590
276774
  };
276591
276775
  const launchProject = async (action, selectedPath) => {
276592
276776
  const path = String(selectedPath || elements.projectPathInput.value).trim();
@@ -276596,10 +276780,16 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
276596
276780
  return;
276597
276781
  }
276598
276782
  if (elements.projectDialogOpen.disabled) return;
276783
+ const projectTab = reserveProjectTab();
276784
+ const pendingButton = action === 'create' ? elements.projectDialogCreate : elements.projectDialogOpen;
276785
+ const pendingLabel = action === 'create' ? copy.projectCreating : copy.projectOpening;
276786
+ const originalLabel = pendingButton.textContent;
276599
276787
  elements.projectDialogBrowse.disabled = true;
276600
276788
  elements.projectDialogOpen.disabled = true;
276601
276789
  elements.projectDialogCreate.disabled = true;
276602
- showToast(copy.projectOpened);
276790
+ pendingButton.textContent = pendingLabel;
276791
+ pendingButton.setAttribute('aria-busy', 'true');
276792
+ showToast(pendingLabel);
276603
276793
  try {
276604
276794
  const result = await api('/api/project', {
276605
276795
  method: 'POST',
@@ -276608,10 +276798,13 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
276608
276798
  });
276609
276799
  closeProjectDialog(false);
276610
276800
  elements.projectPathInput.value = '';
276611
- switchToProject(result);
276801
+ switchToProject(result, projectTab);
276612
276802
  } catch (error) {
276803
+ closeReservedProjectTab(projectTab);
276613
276804
  showToast(error.message || String(error), 'error');
276614
276805
  } finally {
276806
+ pendingButton.textContent = originalLabel;
276807
+ pendingButton.removeAttribute('aria-busy');
276615
276808
  elements.projectDialogBrowse.disabled = false;
276616
276809
  elements.projectDialogOpen.disabled = false;
276617
276810
  elements.projectDialogCreate.disabled = false;
@@ -276681,15 +276874,19 @@ var WEB_UI_CLIENT_BINDINGS_SCRIPT = String.raw` elements.composer.addEventListe
276681
276874
  const button = event.target.closest('[data-project-path]');
276682
276875
  if (!button || button.disabled || state.busy) return;
276683
276876
  state.busy = true;
276877
+ const projectTab = reserveProjectTab();
276684
276878
  button.classList.add('is-switching');
276685
276879
  button.setAttribute('aria-busy', 'true');
276686
- showToast(copy.projectOpened);
276880
+ showToast(copy.projectOpening);
276687
276881
  api('/api/project', {
276688
276882
  method: 'POST',
276689
276883
  headers: { 'Content-Type': 'application/json' },
276690
276884
  body: JSON.stringify({ action: 'open', path: button.dataset.projectPath || '' }),
276691
- }).then(switchToProject)
276692
- .catch((error) => showToast(error.message || String(error), 'error'))
276885
+ }).then((result) => switchToProject(result, projectTab))
276886
+ .catch((error) => {
276887
+ closeReservedProjectTab(projectTab);
276888
+ showToast(error.message || String(error), 'error');
276889
+ })
276693
276890
  .finally(() => {
276694
276891
  state.busy = false;
276695
276892
  button.classList.remove('is-switching');
@@ -277950,8 +278147,10 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
277950
278147
  sessionArchived: '对话已归档',
277951
278148
  sessionRestored: '对话已恢复',
277952
278149
  sessionDeleted: '对话已删除',
277953
- projectOpened: '正在切换到所选工程',
277954
- projectSwitchFailed: '新工程已启动,但无法安全切换页面',
278150
+ projectOpening: '正在新标签页打开项目…',
278151
+ projectCreating: '正在创建项目并打开新标签页…',
278152
+ projectOpened: '项目已在新标签页中打开',
278153
+ projectSwitchFailed: '项目已启动,但无法安全打开页面',
277955
278154
  projectRemoved: '项目已从 Orbit 移除,磁盘文件未删除',
277956
278155
  removeProject: '从 Orbit 移除项目',
277957
278156
  confirmRemoveProject: '再次点击确认移除',
@@ -278100,8 +278299,10 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
278100
278299
  sessionArchived: 'Chat archived',
278101
278300
  sessionRestored: 'Chat restored',
278102
278301
  sessionDeleted: 'Chat deleted',
278103
- projectOpened: 'Switching to the selected project',
278104
- projectSwitchFailed: 'The project started, but Orbit could not switch safely',
278302
+ projectOpening: 'Opening project in a new tab…',
278303
+ projectCreating: 'Creating project and opening a new tab…',
278304
+ projectOpened: 'Project opened in a new tab',
278305
+ projectSwitchFailed: 'The project started, but Orbit could not open it safely',
278105
278306
  projectRemoved: 'Project removed from Orbit; files were not deleted',
278106
278307
  removeProject: 'Remove project from Orbit',
278107
278308
  confirmRemoveProject: 'Click again to confirm removal',
@@ -278214,7 +278415,10 @@ var WEB_UI_CLIENT_FOUNDATION_SCRIPT = String.raw` const byId = (id) => document
278214
278415
  sessionArchived: '對話已封存',
278215
278416
  sessionRestored: '對話已復原',
278216
278417
  sessionDeleted: '對話已刪除',
278217
- projectOpened: '正在切換到所選專案',
278418
+ projectOpening: '正在新分頁開啟專案…',
278419
+ projectCreating: '正在建立專案並開啟新分頁…',
278420
+ projectOpened: '專案已在新分頁中開啟',
278421
+ projectSwitchFailed: '專案已啟動,但無法安全開啟頁面',
278218
278422
  projectRemoved: '專案已從 Orbit 移除,磁碟檔案未刪除',
278219
278423
  removeProject: '從 Orbit 移除專案',
278220
278424
  archiveSession: '封存',
@@ -283507,7 +283711,7 @@ var BASE_COPY = {
283507
283711
  recentProjects: "Recent projects",
283508
283712
  newProject: "New project",
283509
283713
  projectDialogTitle: "Open or create a project",
283510
- projectDialogBody: "Choose an existing folder, or enter the absolute path of a new folder. Orbit opens it in a separate local tab with its own chats and context.",
283714
+ projectDialogBody: "Choose an existing folder, or enter the absolute path of a new folder whose parent already exists. Orbit opens it in a separate local browser tab with its own chats and context.",
283511
283715
  projectPath: "Project folder path",
283512
283716
  projectPathPlaceholder: "C:\\path\\to\\project",
283513
283717
  browseProject: "Browse folders",
@@ -283688,7 +283892,7 @@ var BASE_COPY = {
283688
283892
  recentProjects: "\u6700\u8FD1\u9879\u76EE",
283689
283893
  newProject: "\u65B0\u5EFA\u9879\u76EE",
283690
283894
  projectDialogTitle: "\u6253\u5F00\u6216\u521B\u5EFA\u9879\u76EE",
283691
- projectDialogBody: "\u6D4F\u89C8\u9009\u62E9\u5DF2\u6709\u6587\u4EF6\u5939\uFF0C\u6216\u8F93\u5165\u65B0\u6587\u4EF6\u5939\u7684\u7EDD\u5BF9\u8DEF\u5F84\u3002Orbit \u4F1A\u5728\u65B0\u7684\u672C\u5730\u6807\u7B7E\u9875\u6253\u5F00\uFF0C\u5E76\u4FDD\u7559\u72EC\u7ACB\u7684\u804A\u5929\u548C\u4E0A\u4E0B\u6587\u3002",
283895
+ projectDialogBody: "\u6D4F\u89C8\u9009\u62E9\u5DF2\u6709\u6587\u4EF6\u5939\uFF0C\u6216\u8F93\u5165\u7236\u76EE\u5F55\u5DF2\u5B58\u5728\u7684\u65B0\u6587\u4EF6\u5939\u7EDD\u5BF9\u8DEF\u5F84\u3002Orbit \u4F1A\u5728\u72EC\u7ACB\u7684\u672C\u5730\u6D4F\u89C8\u5668\u6807\u7B7E\u9875\u4E2D\u6253\u5F00\uFF0C\u5E76\u4FDD\u7559\u81EA\u5DF1\u7684\u804A\u5929\u548C\u4E0A\u4E0B\u6587\u3002",
283692
283896
  projectPath: "\u9879\u76EE\u6587\u4EF6\u5939\u8DEF\u5F84",
283693
283897
  projectPathPlaceholder: "C:\\\u8DEF\u5F84\\\u9879\u76EE\u540D\u79F0",
283694
283898
  browseProject: "\u6D4F\u89C8\u6587\u4EF6\u5939",
@@ -283873,7 +284077,7 @@ var COPY = {
283873
284077
  recentProjects: "\u6700\u8FD1\u5C08\u6848",
283874
284078
  newProject: "\u65B0\u589E\u5C08\u6848",
283875
284079
  projectDialogTitle: "\u958B\u555F\u6216\u5EFA\u7ACB\u5C08\u6848",
283876
- projectDialogBody: "\u700F\u89BD\u9078\u64C7\u73FE\u6709\u8CC7\u6599\u593E\uFF0C\u6216\u8F38\u5165\u65B0\u8CC7\u6599\u593E\u7684\u7D55\u5C0D\u8DEF\u5F91\u3002Orbit \u6703\u5728\u65B0\u7684\u672C\u6A5F\u5206\u9801\u958B\u555F\uFF0C\u4E26\u4FDD\u7559\u7368\u7ACB\u7684\u804A\u5929\u548C\u4E0A\u4E0B\u6587\u3002",
284080
+ projectDialogBody: "\u700F\u89BD\u9078\u64C7\u73FE\u6709\u8CC7\u6599\u593E\uFF0C\u6216\u8F38\u5165\u7236\u8CC7\u6599\u593E\u5DF2\u5B58\u5728\u7684\u65B0\u8CC7\u6599\u593E\u7D55\u5C0D\u8DEF\u5F91\u3002Orbit \u6703\u5728\u7368\u7ACB\u7684\u672C\u6A5F\u700F\u89BD\u5668\u5206\u9801\u958B\u555F\uFF0C\u4E26\u4FDD\u7559\u81EA\u5DF1\u7684\u804A\u5929\u548C\u4E0A\u4E0B\u6587\u3002",
283877
284081
  projectPath: "\u5C08\u6848\u8CC7\u6599\u593E\u8DEF\u5F91",
283878
284082
  browseProject: "\u700F\u89BD\u8CC7\u6599\u593E",
283879
284083
  openProject: "\u958B\u555F\u8CC7\u6599\u593E",
@@ -284193,7 +284397,7 @@ function renderWebUiPage(language) {
284193
284397
  <span class="project-chat-count" id="projectChatCount" aria-label="0">0</span>
284194
284398
  <span class="project-toggle-chevron">${renderUiIcon("down")}</span>
284195
284399
  </button>
284196
- <div class="project-chat-body" id="projectChatBody">
284400
+ <div class="project-chat-body" id="projectChatBody" role="region" aria-label="${copy.recentTasks}" tabindex="0">
284197
284401
  <section class="recent-section" id="recentSection" aria-labelledby="recentHeading">
284198
284402
  <div class="nav-section-heading session-section-heading" id="recentHeading">
284199
284403
  <span>${copy.recentTasks}</span><i></i>
@@ -284220,7 +284424,7 @@ function renderWebUiPage(language) {
284220
284424
 
284221
284425
  <section class="recent-projects-shell" id="recentProjectsShell" aria-label="${copy.recentProjects}" hidden>
284222
284426
  <div class="project-list-label">${copy.recentProjects}</div>
284223
- <div class="project-list" id="projectList"></div>
284427
+ <div class="project-list" id="projectList" role="region" aria-label="${copy.recentProjects}" tabindex="0"></div>
284224
284428
  </section>
284225
284429
 
284226
284430
  <div class="sidebar-spacer"></div>
@@ -285849,14 +286053,12 @@ var WEB_UI_CONVERSATION_STYLES = String.raw`
285849
286053
  }
285850
286054
 
285851
286055
  .message-scroll::-webkit-scrollbar,
285852
- .inspector-content::-webkit-scrollbar,
285853
- .sidebar::-webkit-scrollbar {
286056
+ .inspector-content::-webkit-scrollbar {
285854
286057
  width: 9px;
285855
286058
  }
285856
286059
 
285857
286060
  .message-scroll::-webkit-scrollbar-thumb,
285858
- .inspector-content::-webkit-scrollbar-thumb,
285859
- .sidebar::-webkit-scrollbar-thumb {
286061
+ .inspector-content::-webkit-scrollbar-thumb {
285860
286062
  background: color-mix(in srgb, var(--faint) 48%, transparent);
285861
286063
  border: 3px solid transparent;
285862
286064
  border-radius: 9px;
@@ -289889,10 +290091,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
289889
290091
  flex-direction: column;
289890
290092
  gap: 9px;
289891
290093
  padding: 12px 13px;
289892
- overflow-x: hidden;
289893
- overflow-y: auto;
289894
- overscroll-behavior: contain;
289895
- scrollbar-gutter: stable;
290094
+ overflow: hidden;
289896
290095
  color: var(--sidebar-ink);
289897
290096
  background: transparent;
289898
290097
  border-right: 0;
@@ -290158,7 +290357,10 @@ var WEB_UI_SHELL_STYLES = String.raw`
290158
290357
 
290159
290358
  .project-section {
290160
290359
  min-width: 0;
290360
+ min-height: 148px;
290161
290361
  display: grid;
290362
+ grid-template-rows: auto minmax(0, 1fr);
290363
+ flex: 1 1 280px;
290162
290364
  overflow: hidden;
290163
290365
  background: color-mix(in srgb, var(--sidebar-surface) 44%, transparent);
290164
290366
  border: 1px solid var(--sidebar-border);
@@ -290167,7 +290369,11 @@ var WEB_UI_SHELL_STYLES = String.raw`
290167
290369
 
290168
290370
  .recent-projects-shell {
290169
290371
  min-width: 0;
290372
+ min-height: 0;
290373
+ max-height: min(196px, 26dvh);
290170
290374
  display: grid;
290375
+ grid-template-rows: auto minmax(0, 1fr);
290376
+ flex: 0 1 auto;
290171
290377
  gap: 3px;
290172
290378
  margin: 12px 4px 0;
290173
290379
  padding-top: 10px;
@@ -290188,8 +290394,14 @@ var WEB_UI_SHELL_STYLES = String.raw`
290188
290394
 
290189
290395
  .project-list {
290190
290396
  min-width: 0;
290397
+ min-height: 0;
290191
290398
  display: grid;
290399
+ align-content: start;
290192
290400
  gap: 6px;
290401
+ overflow-x: hidden;
290402
+ overflow-y: auto;
290403
+ overscroll-behavior: contain;
290404
+ scrollbar-gutter: stable;
290193
290405
  }
290194
290406
 
290195
290407
  .registered-project {
@@ -290372,10 +290584,56 @@ var WEB_UI_SHELL_STYLES = String.raw`
290372
290584
 
290373
290585
  .project-chat-body {
290374
290586
  min-width: 0;
290587
+ min-height: 0;
290375
290588
  padding: 0 5px 5px;
290589
+ overflow-x: hidden;
290590
+ overflow-y: auto;
290591
+ overscroll-behavior: contain;
290592
+ scrollbar-gutter: stable;
290376
290593
  border-top: 1px solid color-mix(in srgb, var(--sidebar-border) 70%, transparent);
290377
290594
  }
290378
290595
 
290596
+ .project-chat-body,
290597
+ .project-list {
290598
+ scrollbar-width: thin;
290599
+ scrollbar-color: color-mix(in srgb, var(--accent) 42%, var(--sidebar-faint)) color-mix(in srgb, var(--sidebar-border) 36%, transparent);
290600
+ }
290601
+
290602
+ .project-chat-body:focus-visible,
290603
+ .project-list:focus-visible {
290604
+ outline: 2px solid color-mix(in srgb, var(--accent) 58%, transparent);
290605
+ outline-offset: -2px;
290606
+ border-radius: 0 0 11px 11px;
290607
+ }
290608
+
290609
+ .project-chat-body::-webkit-scrollbar,
290610
+ .project-list::-webkit-scrollbar {
290611
+ width: 9px;
290612
+ }
290613
+
290614
+ .project-chat-body::-webkit-scrollbar-track,
290615
+ .project-list::-webkit-scrollbar-track {
290616
+ background: color-mix(in srgb, var(--sidebar-border) 36%, transparent);
290617
+ border-radius: 999px;
290618
+ }
290619
+
290620
+ .project-chat-body::-webkit-scrollbar-thumb,
290621
+ .project-list::-webkit-scrollbar-thumb {
290622
+ min-height: 34px;
290623
+ background: color-mix(in srgb, var(--accent) 42%, var(--sidebar-faint));
290624
+ border: 2px solid transparent;
290625
+ border-radius: 999px;
290626
+ background-clip: padding-box;
290627
+ }
290628
+
290629
+ .project-chat-body:hover::-webkit-scrollbar-thumb,
290630
+ .project-chat-body:focus-within::-webkit-scrollbar-thumb,
290631
+ .project-list:hover::-webkit-scrollbar-thumb,
290632
+ .project-list:focus-within::-webkit-scrollbar-thumb {
290633
+ background: color-mix(in srgb, var(--accent) 48%, var(--sidebar-faint));
290634
+ background-clip: padding-box;
290635
+ }
290636
+
290379
290637
  .project-chat-body[hidden] {
290380
290638
  display: none;
290381
290639
  }
@@ -290384,6 +290642,7 @@ var WEB_UI_SHELL_STYLES = String.raw`
290384
290642
  min-height: 0;
290385
290643
  display: grid;
290386
290644
  grid-template-rows: auto auto minmax(0, auto) auto auto auto;
290645
+ align-content: start;
290387
290646
  margin-top: 2px;
290388
290647
  }
290389
290648
 
@@ -290682,8 +290941,8 @@ var WEB_UI_SHELL_STYLES = String.raw`
290682
290941
  }
290683
290942
 
290684
290943
  .sidebar-spacer {
290685
- min-height: 16px;
290686
- flex: 1 1 auto;
290944
+ min-height: 4px;
290945
+ flex: 0 0 4px;
290687
290946
  }
290688
290947
 
290689
290948
  .workspace-view {
@@ -299533,7 +299792,7 @@ import {
299533
299792
  rmSync as rmSync10,
299534
299793
  writeFileSync as writeFileSync10
299535
299794
  } from "fs";
299536
- import { createHash as createHash9, randomUUID as randomUUID16 } from "crypto";
299795
+ import { createHash as createHash10, randomUUID as randomUUID16 } from "crypto";
299537
299796
  import { dirname as dirname17, isAbsolute as isAbsolute8, join as join21, relative as relative10, resolve as resolve18, sep as sep2 } from "path";
299538
299797
  import { z as z77 } from "zod";
299539
299798
  var MAX_BACKUP_BYTES = 64 * 1024 * 1024;
@@ -299802,7 +300061,7 @@ function normalizeBundlePath(filePath) {
299802
300061
  return normalized;
299803
300062
  }
299804
300063
  function hash(content) {
299805
- return createHash9("sha256").update(content).digest("hex");
300064
+ return createHash10("sha256").update(content).digest("hex");
299806
300065
  }
299807
300066
  function formatBytes2(bytes) {
299808
300067
  return `${Math.round(bytes / (1024 * 1024))} MiB`;