dsh-github-copilot 0.4.0-alpha.92 → 0.4.0-alpha.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -5491,7 +5491,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5491
5491
  expectedRevision: revision
5492
5492
  }).strict();
5493
5493
  const DualModelCreateResultSchema = object({ sessionId: id }).strict();
5494
- const contribution$4 = {
5494
+ const contribution$5 = {
5495
5495
  package: "dsh-github-copilot",
5496
5496
  descriptors: [
5497
5497
  {
@@ -5539,7 +5539,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5539
5539
  supported: boolean(),
5540
5540
  providers: array(object({ id: string().min(1).max(512) }).strict()).max(512)
5541
5541
  }).strict();
5542
- const contribution$3 = {
5542
+ const contribution$4 = {
5543
5543
  package: "dsh-github-copilot",
5544
5544
  descriptors: [{
5545
5545
  id: "dsh-github-copilot:githubCopilotSearchRouting.providers",
@@ -5632,7 +5632,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5632
5632
  if (view.remaining !== void 0 && view.percentUsed !== void 0 && Math.abs((1 - view.remaining / view.limit) * 100 - view.percentUsed) > 1) invalid();
5633
5633
  }
5634
5634
  });
5635
- const contribution$2 = {
5635
+ const contribution$3 = {
5636
5636
  package: "dsh-github-copilot",
5637
5637
  descriptors: ["get", "refresh"].map((method) => ({
5638
5638
  id: `dsh-github-copilot:githubCopilotUsage.${method}`,
@@ -5756,7 +5756,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5756
5756
  ]);
5757
5757
  //#endregion
5758
5758
  //#region lib/types/turn-selection-remote.js
5759
- const contribution$1 = {
5759
+ const contribution$2 = {
5760
5760
  package: "dsh-github-copilot",
5761
5761
  descriptors: [{
5762
5762
  id: "dsh-github-copilot:githubCopilotTurnSelection.get",
@@ -5780,6 +5780,57 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5780
5780
  }]
5781
5781
  };
5782
5782
  //#endregion
5783
+ //#region lib/types/replay-recovery-types.js
5784
+ const ReplayRecoveryViewSchema = discriminatedUnion("state", [object({ state: literal("unavailable") }).strict(), object({
5785
+ state: _enum(["available", "enabled"]),
5786
+ revision: string().uuid(),
5787
+ itemCount: number().int().positive().max(512),
5788
+ model: string().min(1).max(256)
5789
+ }).strict()]);
5790
+ //#endregion
5791
+ //#region lib/types/replay-recovery-remote.js
5792
+ const agent = {
5793
+ name: "agent",
5794
+ wire: "agentId",
5795
+ source: "lookup",
5796
+ lookup: "agent",
5797
+ codec: strictRemoteCodec("@deepseek-ai/dsh-session/types#SessionId", string().min(1).max(256))
5798
+ };
5799
+ const contribution$1 = {
5800
+ package: "dsh-github-copilot",
5801
+ descriptors: [{
5802
+ id: "dsh-github-copilot:githubCopilotReplayRecovery.get",
5803
+ namespace: "githubCopilotReplayRecovery",
5804
+ service: "githubCopilotReplayRecovery",
5805
+ method: "get",
5806
+ invocation: { kind: "direct" },
5807
+ parameters: [agent],
5808
+ result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
5809
+ }, {
5810
+ id: "dsh-github-copilot:githubCopilotReplayRecovery.setEnabled",
5811
+ namespace: "githubCopilotReplayRecovery",
5812
+ service: "githubCopilotReplayRecovery",
5813
+ method: "setEnabled",
5814
+ invocation: { kind: "direct" },
5815
+ parameters: [
5816
+ agent,
5817
+ {
5818
+ name: "revision",
5819
+ wire: "revision",
5820
+ source: "json",
5821
+ codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryRevision", string().uuid())
5822
+ },
5823
+ {
5824
+ name: "enabled",
5825
+ wire: "enabled",
5826
+ source: "json",
5827
+ codec: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryEnabled", boolean())
5828
+ }
5829
+ ],
5830
+ result: strictRemoteCodec("dsh-github-copilot#ReplayRecoveryView", ReplayRecoveryViewSchema)
5831
+ }]
5832
+ };
5833
+ //#endregion
5783
5834
  //#region lib/types/remote.js
5784
5835
  /**
5785
5836
  * Client-safe Remote contribution for the plugin-owned authorization bridge.
@@ -5988,6 +6039,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5988
6039
  parameters: [],
5989
6040
  result: strictRemoteCodec(GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL, GitHubCopilotMigrationStatusSchema)
5990
6041
  },
6042
+ ...contribution$5.descriptors,
5991
6043
  ...contribution$4.descriptors,
5992
6044
  ...contribution$3.descriptors,
5993
6045
  ...contribution$2.descriptors,
@@ -6006,15 +6058,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6006
6058
  const ASSISTANT_ORIGIN_KEY = "github-copilot-assistant-origin";
6007
6059
  const CHAT_NODE_SLOT = "conversation.chat.node";
6008
6060
  const ASSISTANT_KEY = "assistant-step";
6009
- const noop$3 = () => {};
6010
- function record$6(value) {
6061
+ const noop$4 = () => {};
6062
+ function record$7(value) {
6011
6063
  return typeof value === "object" && value !== null;
6012
6064
  }
6013
6065
  function sequence$1(value) {
6014
6066
  return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
6015
6067
  }
6016
6068
  function eventLocation(event) {
6017
- if (!record$6(event) || !record$6(event.data)) return void 0;
6069
+ if (!record$7(event) || !record$7(event.data)) return void 0;
6018
6070
  const { turn, step } = event.data;
6019
6071
  return sequence$1(turn) && sequence$1(step) ? {
6020
6072
  turn,
@@ -6022,9 +6074,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6022
6074
  } : void 0;
6023
6075
  }
6024
6076
  function messageOrigin(event) {
6025
- if (!record$6(event) || event.type !== "assistant/message" || event.surfaceOp !== "append" || !sequence$1(event.seq) || !record$6(event.data) || !record$6(event.data.message)) return void 0;
6077
+ if (!record$7(event) || event.type !== "assistant/message" || event.surfaceOp !== "append" || !sequence$1(event.seq) || !record$7(event.data) || !record$7(event.data.message)) return void 0;
6026
6078
  const source = event.data.message.source;
6027
- if (!record$6(source) || typeof source.provider !== "string" || source.provider.trim() === "" || typeof source.model !== "string" || source.model.trim() === "") return void 0;
6079
+ if (!record$7(source) || typeof source.provider !== "string" || source.provider.trim() === "" || typeof source.model !== "string" || source.model.trim() === "") return void 0;
6028
6080
  return {
6029
6081
  seq: event.seq,
6030
6082
  provider: source.provider,
@@ -6035,7 +6087,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6035
6087
  const assistantOriginDefinition = {
6036
6088
  kind: ASSISTANT_ORIGIN_KEY,
6037
6089
  match(event) {
6038
- if (!record$6(event)) return null;
6090
+ if (!record$7(event)) return null;
6039
6091
  const location = eventLocation(event);
6040
6092
  if (location === void 0) return null;
6041
6093
  if (event.type === "step/start") return {
@@ -6050,14 +6102,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6050
6102
  },
6051
6103
  start(_context, match) {
6052
6104
  const location = eventLocation(match.event);
6053
- if (location === void 0 || !record$6(match.event) || match.event.type !== "step/start") throw new Error("COPILOT_REASONING_ORIGIN_START: expected step/start");
6105
+ if (location === void 0 || !record$7(match.event) || match.event.type !== "step/start") throw new Error("COPILOT_REASONING_ORIGIN_START: expected step/start");
6054
6106
  return {
6055
6107
  ...location,
6056
6108
  origin: void 0
6057
6109
  };
6058
6110
  },
6059
6111
  update(context, match) {
6060
- if (!record$6(match.event) || match.event.type !== "assistant/message" || match.event.surfaceOp !== "append") return context.state;
6112
+ if (!record$7(match.event) || match.event.type !== "assistant/message" || match.event.surfaceOp !== "append") return context.state;
6061
6113
  return {
6062
6114
  ...context.state,
6063
6115
  origin: messageOrigin(match.event)
@@ -6068,7 +6120,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6068
6120
  let state = context.state;
6069
6121
  if (state === void 0) for (const match of context.matches) {
6070
6122
  const event = match.event;
6071
- if (!record$6(event) || event.type !== "assistant/message" || event.surfaceOp !== "append") continue;
6123
+ if (!record$7(event) || event.type !== "assistant/message" || event.surfaceOp !== "append") continue;
6072
6124
  const location = eventLocation(event);
6073
6125
  if (location !== void 0) state = {
6074
6126
  ...location,
@@ -6089,12 +6141,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6089
6141
  };
6090
6142
  /** Shallow UI-only projection. Unchanged input retains its exact props identity. */
6091
6143
  function projectReasoningPresentation(props, origin) {
6092
- if (!record$6(props) || !record$6(props.node) || props.node.kind !== ASSISTANT_KEY || !record$6(props.node.data) || !record$6(origin)) return props;
6144
+ if (!record$7(props) || !record$7(props.node) || props.node.kind !== ASSISTANT_KEY || !record$7(props.node.data) || !record$7(origin)) return props;
6093
6145
  const node = props.node;
6094
6146
  const data = node.data;
6095
- if (data.status !== "settled" || !record$6(data.finalNode) || !sequence$1(data.finalNode.seq) || origin.seq !== data.finalNode.seq) return props;
6147
+ if (data.status !== "settled" || !record$7(data.finalNode) || !sequence$1(data.finalNode.seq) || origin.seq !== data.finalNode.seq) return props;
6096
6148
  if (!(origin.provider === "github-copilot" || origin.provider === "github-copilot-preview") || typeof origin.model !== "string" || origin.model.trim() === "" || !Array.isArray(data.blocks)) return props;
6097
- const blocks = data.blocks.filter((block) => !(record$6(block) && block.kind === "reasoning" && typeof block.text === "string" && block.text.trim() === ""));
6149
+ const blocks = data.blocks.filter((block) => !(record$7(block) && block.kind === "reasoning" && typeof block.text === "string" && block.text.trim() === ""));
6098
6150
  if (blocks.length === data.blocks.length) return props;
6099
6151
  return {
6100
6152
  ...props,
@@ -6109,16 +6161,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6109
6161
  }
6110
6162
  const missingOriginSource = {
6111
6163
  getSnapshot: () => void 0,
6112
- subscribe: () => noop$3
6164
+ subscribe: () => noop$4
6113
6165
  };
6114
6166
  function originSource(props) {
6115
6167
  const node = props.node;
6116
- if (!record$6(node) || !record$6(node.location) || node.location.kind !== "step" || !record$6(node.location.step) || !record$6(node.location.step.data)) return missingOriginSource;
6168
+ if (!record$7(node) || !record$7(node.location) || node.location.kind !== "step" || !record$7(node.location.step) || !record$7(node.location.step.data)) return missingOriginSource;
6117
6169
  const store = node.location.step.data;
6118
6170
  if (typeof store.source !== "function") return missingOriginSource;
6119
6171
  try {
6120
6172
  const source = store.source(ASSISTANT_ORIGIN_KEY);
6121
- if (!record$6(source) || typeof source.getSnapshot !== "function" || typeof source.subscribe !== "function") return missingOriginSource;
6173
+ if (!record$7(source) || typeof source.getSnapshot !== "function" || typeof source.subscribe !== "function") return missingOriginSource;
6122
6174
  return source;
6123
6175
  } catch {
6124
6176
  return missingOriginSource;
@@ -6132,7 +6184,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6132
6184
  */
6133
6185
  function supportedNative(entry) {
6134
6186
  const component = entry.component;
6135
- return (entry.options.priority ?? 0) === 0 && entry.locale === "chat" && entry.options.id === void 0 && entry.options.order === void 0 && entry.options.label === void 0 && entry.inject === void 0 && entry.store === void 0 && entry.children === void 0 && entry.select === void 0 && record$6(component) && component.$$typeof === Symbol.for("react.memo") && typeof component.type === "function" && component.type.name === "AssistantNodeView";
6187
+ return (entry.options.priority ?? 0) === 0 && entry.locale === "chat" && entry.options.id === void 0 && entry.options.order === void 0 && entry.options.label === void 0 && entry.inject === void 0 && entry.store === void 0 && entry.children === void 0 && entry.select === void 0 && record$7(component) && component.$$typeof === Symbol.for("react.memo") && typeof component.type === "function" && component.type.name === "AssistantNodeView";
6136
6188
  }
6137
6189
  /**
6138
6190
  * Optional Client enhancement. The caller owns the returned disposer in its
@@ -6142,20 +6194,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6142
6194
  const { diagnostic } = capabilities;
6143
6195
  const slotsCandidate = capabilities.slots;
6144
6196
  const conversation = capabilities.uiConversation;
6145
- if (!record$6(slotsCandidate) || ![
6197
+ if (!record$7(slotsCandidate) || ![
6146
6198
  "entries",
6147
6199
  "spec",
6148
6200
  "subscribe",
6149
6201
  "inject",
6150
6202
  "register"
6151
- ].every((key) => typeof slotsCandidate[key] === "function") || !record$6(conversation) || !record$6(conversation.events) || typeof conversation.events.register !== "function") {
6203
+ ].every((key) => typeof slotsCandidate[key] === "function") || !record$7(conversation) || !record$7(conversation.events) || typeof conversation.events.register !== "function") {
6152
6204
  diagnostic("COPILOT_REASONING_PRESENTATION_UNAVAILABLE");
6153
- return noop$3;
6205
+ return noop$4;
6154
6206
  }
6155
6207
  const slots = slotsCandidate;
6156
6208
  const events = conversation.events;
6157
- let removeOrigin = noop$3;
6158
- let removeInjection = noop$3;
6209
+ let removeOrigin = noop$4;
6210
+ let removeInjection = noop$4;
6159
6211
  let disposed = false;
6160
6212
  try {
6161
6213
  removeOrigin = events.register(assistantOriginDefinition);
@@ -6163,7 +6215,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6163
6215
  const spec = slots.spec(CHAT_NODE_SLOT);
6164
6216
  if (spec?.kind !== "keyed" || spec.scope !== "session") {
6165
6217
  diagnostic("COPILOT_REASONING_SLOT_UNSUPPORTED");
6166
- return noop$3;
6218
+ return noop$4;
6167
6219
  }
6168
6220
  let active = true;
6169
6221
  let reconciling = false;
@@ -6171,7 +6223,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6171
6223
  let native;
6172
6224
  let failedNative;
6173
6225
  let wrapper;
6174
- let unregister = noop$3;
6226
+ let unregister = noop$4;
6175
6227
  let lastDiagnostic;
6176
6228
  const report = (code) => {
6177
6229
  if (lastDiagnostic !== code) diagnostic(code);
@@ -6179,7 +6231,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6179
6231
  };
6180
6232
  const retire = () => {
6181
6233
  const remove = unregister;
6182
- unregister = noop$3;
6234
+ unregister = noop$4;
6183
6235
  native = void 0;
6184
6236
  remove();
6185
6237
  wrapper = void 0;
@@ -6241,7 +6293,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6241
6293
  removeInjection();
6242
6294
  removeOrigin();
6243
6295
  diagnostic("COPILOT_REASONING_REGISTRATION_FAILED");
6244
- return noop$3;
6296
+ return noop$4;
6245
6297
  }
6246
6298
  return () => {
6247
6299
  if (disposed) return;
@@ -6253,14 +6305,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6253
6305
  //#endregion
6254
6306
  //#region lib/types/turn-model-provenance.js
6255
6307
  const TURN_MODEL_PROVENANCE_KEY = "github-copilot-turn-model-provenance";
6256
- function record$5(value) {
6308
+ function record$6(value) {
6257
6309
  return typeof value === "object" && value !== null;
6258
6310
  }
6259
6311
  function isTurnModelProvenance(value) {
6260
- return record$5(value) && typeof value.ended === "boolean" && typeof value.incomplete === "boolean" && Array.isArray(value.routes) && value.routes.every((route) => record$5(route) && typeof route.provider === "string" && route.provider.trim() !== "" && typeof route.model === "string" && route.model.trim() !== "");
6312
+ return record$6(value) && typeof value.ended === "boolean" && typeof value.incomplete === "boolean" && Array.isArray(value.routes) && value.routes.every((route) => record$6(route) && typeof route.provider === "string" && route.provider.trim() !== "" && typeof route.model === "string" && route.model.trim() !== "");
6261
6313
  }
6262
6314
  function coordinates$1(event) {
6263
- if (!record$5(event) || typeof event.type !== "string" || !record$5(event.data) || !Number.isSafeInteger(event.data.turn) || typeof event.data.turn !== "number" || event.data.turn < 0 || ![
6315
+ if (!record$6(event) || typeof event.type !== "string" || !record$6(event.data) || !Number.isSafeInteger(event.data.turn) || typeof event.data.turn !== "number" || event.data.turn < 0 || ![
6264
6316
  "turn/start",
6265
6317
  "turn/end",
6266
6318
  "step/start",
@@ -6293,8 +6345,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6293
6345
  let missing = false;
6294
6346
  let route;
6295
6347
  if (parsed.type === "assistant/message") {
6296
- const source = record$5(parsed.data.message) ? parsed.data.message.source : void 0;
6297
- if (record$5(source) && typeof source.provider === "string" && source.provider.trim() !== "" && typeof source.model === "string" && source.model.trim() !== "") route = {
6348
+ const source = record$6(parsed.data.message) ? parsed.data.message.source : void 0;
6349
+ if (record$6(source) && typeof source.provider === "string" && source.provider.trim() !== "" && typeof source.model === "string" && source.model.trim() !== "") route = {
6298
6350
  provider: source.provider,
6299
6351
  model: source.model
6300
6352
  };
@@ -6537,17 +6589,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6537
6589
  //#endregion
6538
6590
  //#region lib/types/turn-usage-evidence.js
6539
6591
  const TURN_USAGE_EVIDENCE_KEY = "github-copilot-turn-usage-evidence";
6540
- function record$4(value) {
6592
+ function record$5(value) {
6541
6593
  return typeof value === "object" && value !== null && !Array.isArray(value);
6542
6594
  }
6543
6595
  function count$1(value) {
6544
6596
  return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
6545
6597
  }
6546
6598
  function isTurnUsageEvidence(value) {
6547
- return record$4(value) && typeof value.ended === "boolean" && typeof value.hasStart === "boolean" && count$1(value.localPreDispatchBlocks) && count$1(value.unreportedAttempts) && (value.requestBodyTimeouts === void 0 || count$1(value.requestBodyTimeouts) && value.requestBodyTimeouts <= value.unreportedAttempts) && (value.timeoutDetails === void 0 || Array.isArray(value.timeoutDetails) && value.timeoutDetails.length <= 8 && count$1(value.requestBodyTimeouts) && value.timeoutDetails.length <= value.requestBodyTimeouts && value.timeoutDetails.every((detail) => record$4(detail) && typeof detail.recovered === "boolean" && (detail.step === void 0 || count$1(detail.step)) && (detail.seq === void 0 || count$1(detail.seq)) && (!detail.recovered || count$1(detail.step) && count$1(detail.seq))));
6599
+ return record$5(value) && typeof value.ended === "boolean" && typeof value.hasStart === "boolean" && count$1(value.localPreDispatchBlocks) && count$1(value.unreportedAttempts) && (value.requestBodyTimeouts === void 0 || count$1(value.requestBodyTimeouts) && value.requestBodyTimeouts <= value.unreportedAttempts) && (value.timeoutDetails === void 0 || Array.isArray(value.timeoutDetails) && value.timeoutDetails.length <= 8 && count$1(value.requestBodyTimeouts) && value.timeoutDetails.length <= value.requestBodyTimeouts && value.timeoutDetails.every((detail) => record$5(detail) && typeof detail.recovered === "boolean" && (detail.step === void 0 || count$1(detail.step)) && (detail.seq === void 0 || count$1(detail.seq)) && (!detail.recovered || count$1(detail.step) && count$1(detail.seq))));
6548
6600
  }
6549
6601
  function coordinates(event) {
6550
- if (!record$4(event) || typeof event.type !== "string" || !record$4(event.data) || !count$1(event.data.turn) || ![
6602
+ if (!record$5(event) || typeof event.type !== "string" || !record$5(event.data) || !count$1(event.data.turn) || ![
6551
6603
  "turn/start",
6552
6604
  "turn/end",
6553
6605
  "step/start",
@@ -6568,27 +6620,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6568
6620
  function finishReason(data) {
6569
6621
  if (!Array.isArray(data.stream)) return void 0;
6570
6622
  let result;
6571
- for (const entry of data.stream) if (record$4(entry) && entry.type === "chunk" && record$4(entry.chunk) && entry.chunk.type === "finish") {
6572
- if (result !== void 0 || !record$4(entry.chunk.reason)) return void 0;
6623
+ for (const entry of data.stream) if (record$5(entry) && entry.type === "chunk" && record$5(entry.chunk) && entry.chunk.type === "finish") {
6624
+ if (result !== void 0 || !record$5(entry.chunk.reason)) return void 0;
6573
6625
  result = entry.chunk.reason;
6574
6626
  }
6575
6627
  return result;
6576
6628
  }
6577
6629
  function requestBodyTimeout(data) {
6578
6630
  const reason = finishReason(data);
6579
- if (reason?.kind !== "error" || !record$4(reason.failure)) return false;
6631
+ if (reason?.kind !== "error" || !record$5(reason.failure)) return false;
6580
6632
  const { code, message } = reason.failure;
6581
6633
  return typeof code === "string" && code !== "ABORTED" && typeof message === "string" && message.length <= 8192 && (message === "COPILOT_REQUEST_BODY_TIMEOUT: Copilot returned HTTP 408 / user_request_timeout while reading the request body; this is not context-window overflow." || message.startsWith(`COPILOT_REQUEST_BODY_TIMEOUT: Copilot returned HTTP 408 / user_request_timeout while reading the request body; this is not context-window overflow. `));
6582
6634
  }
6583
6635
  function unreported(type, data) {
6584
6636
  if (type === "assistant/message" && data.usage !== void 0) return false;
6585
- return !Array.isArray(data.stream) || !data.stream.some((entry) => record$4(entry) && entry.type === "chunk" && record$4(entry.chunk) && entry.chunk.type === "usage" && entry.chunk.usage !== void 0);
6637
+ return !Array.isArray(data.stream) || !data.stream.some((entry) => record$5(entry) && entry.type === "chunk" && record$5(entry.chunk) && entry.chunk.type === "usage" && entry.chunk.usage !== void 0);
6586
6638
  }
6587
6639
  /** Recognize only our recorded finish-only diagnostic; never infer dispatch from a generic error. */
6588
6640
  function localBlock(data) {
6589
6641
  if (!Array.isArray(data.stream) || data.stream.length !== 1) return false;
6590
6642
  const entry = data.stream[0];
6591
- if (!record$4(entry) || entry.type !== "chunk" || !record$4(entry.chunk) || entry.chunk.type !== "finish" || !record$4(entry.chunk.reason) || entry.chunk.reason.kind !== "error" || !record$4(entry.chunk.reason.failure)) return false;
6643
+ if (!record$5(entry) || entry.type !== "chunk" || !record$5(entry.chunk) || entry.chunk.type !== "finish" || !record$5(entry.chunk.reason) || entry.chunk.reason.kind !== "error" || !record$5(entry.chunk.reason.failure)) return false;
6592
6644
  const failure = entry.chunk.reason.failure;
6593
6645
  if (failure.code !== "CONTEXT_WINDOW_EXCEEDED" || typeof failure.message !== "string" || failure.message.length > 256) return false;
6594
6646
  const match = /^Copilot local estimated input budget exceeded \((\d+) estimated tokens > (\d+) budget tokens\); requesting stock compaction before provider dispatch\.$/.exec(failure.message);
@@ -6663,7 +6715,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6663
6715
  }
6664
6716
  /** Native completed-tail evidence gates the notice; native totals are never replaced. */
6665
6717
  function turnUsageDiagnostic(turn, tail, evidence, copilot) {
6666
- if (!count$1(turn) || !record$4(tail) || tail.turn !== turn || !count$1(tail.seq) || tail.tokenUsage !== void 0) return void 0;
6718
+ if (!count$1(turn) || !record$5(tail) || tail.turn !== turn || !count$1(tail.seq) || tail.tokenUsage !== void 0) return void 0;
6667
6719
  const parsed = isTurnUsageEvidence(evidence) && evidence.ended ? evidence : void 0;
6668
6720
  if (!copilot && (parsed?.localPreDispatchBlocks ?? 0) === 0) return void 0;
6669
6721
  return {
@@ -6834,15 +6886,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6834
6886
  //#region lib/types/auto-model-presentation.js
6835
6887
  const AUTO_MODEL_ATTRIBUTION_KEY = "github-copilot-auto-model-attribution";
6836
6888
  const SLOT = "conversation.chat.assistant-actions";
6837
- const noop$2 = () => {};
6838
- function record$3(value) {
6889
+ const noop$3 = () => {};
6890
+ function record$4(value) {
6839
6891
  return typeof value === "object" && value !== null;
6840
6892
  }
6841
6893
  function sequence(value) {
6842
6894
  return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
6843
6895
  }
6844
6896
  function attribution(event) {
6845
- if (!record$3(event) || event.type !== "github-copilot/auto-model-decision" || !record$3(event.data) || !sequence(event.data.turn) || event.data.provider !== "github-copilot-preview" || typeof event.data.model !== "string" || event.data.model.trim() === "" || ![
6897
+ if (!record$4(event) || event.type !== "github-copilot/auto-model-decision" || !record$4(event.data) || !sequence(event.data.turn) || event.data.provider !== "github-copilot-preview" || typeof event.data.model !== "string" || event.data.model.trim() === "" || ![
6846
6898
  "fast",
6847
6899
  "balanced",
6848
6900
  "strong"
@@ -6904,14 +6956,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6904
6956
  };
6905
6957
  const missingSource = {
6906
6958
  getSnapshot: () => void 0,
6907
- subscribe: () => noop$2
6959
+ subscribe: () => noop$3
6908
6960
  };
6909
6961
  function sourceOf(props, key, diagnostic, failure = "COPILOT_TURN_SELECTION_PROJECTION_FAILED") {
6910
6962
  const turn = props.turn;
6911
- if (!record$3(turn) || !record$3(turn.data) || typeof turn.data.source !== "function") return missingSource;
6963
+ if (!record$4(turn) || !record$4(turn.data) || typeof turn.data.source !== "function") return missingSource;
6912
6964
  try {
6913
6965
  const source = turn.data.source(key);
6914
- return record$3(source) && typeof source.getSnapshot === "function" && typeof source.subscribe === "function" ? source : missingSource;
6966
+ return record$4(source) && typeof source.getSnapshot === "function" && typeof source.subscribe === "function" ? source : missingSource;
6915
6967
  } catch {
6916
6968
  diagnostic(failure);
6917
6969
  return missingSource;
@@ -6922,7 +6974,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6922
6974
  }
6923
6975
  function findTail(snapshot, messageId, diagnostic) {
6924
6976
  if (typeof messageId !== "string") return void 0;
6925
- if (!record$3(snapshot) || !record$3(snapshot.nodes) || typeof snapshot.nodes.values !== "function") {
6977
+ if (!record$4(snapshot) || !record$4(snapshot.nodes) || typeof snapshot.nodes.values !== "function") {
6926
6978
  diagnostic("COPILOT_TURN_SELECTION_CHAT_NODES_UNAVAILABLE");
6927
6979
  return;
6928
6980
  }
@@ -6932,16 +6984,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6932
6984
  return;
6933
6985
  }
6934
6986
  for (const node of nodes) {
6935
- if (!record$3(node) || node.kind !== "turn-tail" || !record$3(node.data) || !record$3(node.data.closing)) continue;
6987
+ if (!record$4(node) || node.kind !== "turn-tail" || !record$4(node.data) || !record$4(node.data.closing)) continue;
6936
6988
  const closing = node.data.closing;
6937
- if (record$3(closing.finalNode) && closing.finalNode.messageId === messageId && record$3(node.location)) return node;
6989
+ if (record$4(closing.finalNode) && closing.finalNode.messageId === messageId && record$4(node.location)) return node;
6938
6990
  }
6939
6991
  }
6940
6992
  function Attribution(props) {
6941
6993
  const [live, setLive] = react.useState({ mode: "unknown" });
6942
6994
  const [readState, setReadState] = react.useState("loading");
6943
6995
  const [readAttempt, setReadAttempt] = react.useState(0);
6944
- const turn = record$3(props.turn) && sequence(props.turn.turn) ? props.turn.turn : void 0;
6996
+ const turn = record$4(props.turn) && sequence(props.turn.turn) ? props.turn.turn : void 0;
6945
6997
  const sessionId = typeof props.sessionId === "string" ? props.sessionId : void 0;
6946
6998
  react.useEffect(() => {
6947
6999
  setLive({ mode: "unknown" });
@@ -6977,7 +7029,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6977
7029
  props.diagnostic,
6978
7030
  readAttempt
6979
7031
  ]);
6980
- const language = react.useSyncExternalStore(props.locale ? (listener) => props.locale.subscribe(listener) : () => noop$2, () => props.locale?.getLocale().active ?? "en", () => "en");
7032
+ const language = react.useSyncExternalStore(props.locale ? (listener) => props.locale.subscribe(listener) : () => noop$3, () => props.locale?.getLocale().active ?? "en", () => "en");
6981
7033
  const source = sourceOf(props, AUTO_MODEL_ATTRIBUTION_KEY, props.diagnostic);
6982
7034
  const value = react.useSyncExternalStore(source.subscribe, source.getSnapshot, source.getSnapshot);
6983
7035
  const provenanceSource = sourceOf(props, TURN_MODEL_PROVENANCE_KEY, props.diagnostic);
@@ -6987,17 +7039,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6987
7039
  const parsed = attribution({
6988
7040
  type: "github-copilot/auto-model-decision",
6989
7041
  data: {
6990
- ...record$3(value) ? value : {},
7042
+ ...record$4(value) ? value : {},
6991
7043
  turn: 0
6992
7044
  }
6993
7045
  })?.value;
6994
7046
  const evidence = isTurnModelProvenance(provenance) ? provenance : void 0;
6995
- const native = record$3(props.tail) && record$3(props.tail.data) ? props.tail.data : void 0;
7047
+ const native = record$4(props.tail) && record$4(props.tail.data) ? props.tail.data : void 0;
6996
7048
  const nativeCompleted = native?.turn === turn && sequence(native?.seq);
6997
7049
  if (evidence?.ended !== true && !nativeCompleted) return null;
6998
7050
  if (evidence === void 0) props.diagnostic("COPILOT_TURN_SELECTION_PROVENANCE_UNAVAILABLE");
6999
- const nativeRoutes = nativeCompleted && record$3(native?.tokenUsage) && Array.isArray(native.tokenUsage.routes) ? native.tokenUsage.routes : [];
7000
- const copilot = (evidence?.routes ?? nativeRoutes).some((route) => record$3(route) && (route.provider === "github-copilot-preview" || route.provider === "github-copilot") && typeof route.model === "string" && route.model.trim() !== "");
7051
+ const nativeRoutes = nativeCompleted && record$4(native?.tokenUsage) && Array.isArray(native.tokenUsage.routes) ? native.tokenUsage.routes : [];
7052
+ const copilot = (evidence?.routes ?? nativeRoutes).some((route) => record$4(route) && (route.provider === "github-copilot-preview" || route.provider === "github-copilot") && typeof route.model === "string" && route.model.trim() !== "");
7001
7053
  const usageDiagnostic = turn === void 0 ? void 0 : turnUsageDiagnostic(turn, native, usageEvidence, copilot);
7002
7054
  if (!copilot && parsed === void 0 && live.mode === "unknown" && usageDiagnostic === void 0) return null;
7003
7055
  if (usageDiagnostic !== void 0 && !isTurnUsageEvidence(usageEvidence)) props.diagnostic("COPILOT_TURN_USAGE_EVIDENCE_UNAVAILABLE");
@@ -7020,14 +7072,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7020
7072
  }));
7021
7073
  }
7022
7074
  function installAutoModelProjections(capabilities) {
7023
- if (!record$3(capabilities.uiConversation) || !record$3(capabilities.uiConversation.events) || typeof capabilities.uiConversation.events.register !== "function") {
7075
+ if (!record$4(capabilities.uiConversation) || !record$4(capabilities.uiConversation.events) || typeof capabilities.uiConversation.events.register !== "function") {
7024
7076
  capabilities.diagnostic("COPILOT_AUTO_PROJECTIONS_UNAVAILABLE");
7025
- return noop$2;
7077
+ return noop$3;
7026
7078
  }
7027
7079
  const events = capabilities.uiConversation.events;
7028
- let removeDefinition = noop$2;
7029
- let removeProvenance = noop$2;
7030
- let removeUsage = noop$2;
7080
+ let removeDefinition = noop$3;
7081
+ let removeProvenance = noop$3;
7082
+ let removeUsage = noop$3;
7031
7083
  try {
7032
7084
  removeDefinition = events.register(autoModelAttributionDefinition);
7033
7085
  removeProvenance = events.register(turnModelProvenanceDefinition);
@@ -7035,7 +7087,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7035
7087
  removeProvenance();
7036
7088
  removeDefinition();
7037
7089
  capabilities.diagnostic("COPILOT_AUTO_PROJECTIONS_FAILED");
7038
- return noop$2;
7090
+ return noop$3;
7039
7091
  }
7040
7092
  try {
7041
7093
  removeUsage = events.register(turnUsageEvidenceDefinition);
@@ -7057,18 +7109,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7057
7109
  }
7058
7110
  };
7059
7111
  const slotsCandidate = capabilities.slots;
7060
- if (!record$3(slotsCandidate) || ![
7112
+ if (!record$4(slotsCandidate) || ![
7061
7113
  "spec",
7062
7114
  "inject",
7063
7115
  "register"
7064
7116
  ].every((key) => typeof slotsCandidate[key] === "function")) {
7065
7117
  diagnostic("COPILOT_AUTO_PRESENTATION_UNAVAILABLE");
7066
- return noop$2;
7118
+ return noop$3;
7067
7119
  }
7068
7120
  const slots = slotsCandidate;
7069
- const face = record$3(capabilities.remote) ? capabilities.remote.githubCopilotTurnSelection : void 0;
7070
- const remote = record$3(face) && typeof face.get === "function" ? face : void 0;
7071
- const locale = record$3(capabilities.locale) && typeof capabilities.locale.getLocale === "function" && typeof capabilities.locale.subscribe === "function" ? capabilities.locale : void 0;
7121
+ const face = record$4(capabilities.remote) ? capabilities.remote.githubCopilotTurnSelection : void 0;
7122
+ const remote = record$4(face) && typeof face.get === "function" ? face : void 0;
7123
+ const locale = record$4(capabilities.locale) && typeof capabilities.locale.getLocale === "function" && typeof capabilities.locale.subscribe === "function" ? capabilities.locale : void 0;
7072
7124
  if (!remote) diagnostic("COPILOT_TURN_SELECTION_REMOTE_UNAVAILABLE");
7073
7125
  function Entry(props) {
7074
7126
  if (typeof props.useChat !== "function") {
@@ -7077,8 +7129,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7077
7129
  }
7078
7130
  const useChat = props.useChat;
7079
7131
  const tail = useChat((snapshot) => findTail(snapshot, props.messageId, diagnostic));
7080
- const turn = record$3(tail) && record$3(tail.location) ? tail.location.turn : void 0;
7081
- if (!record$3(turn) || !sequence(turn.turn)) return null;
7132
+ const turn = record$4(tail) && record$4(tail.location) ? tail.location.turn : void 0;
7133
+ if (!record$4(turn) || !sequence(turn.turn)) return null;
7082
7134
  return react.createElement(Attribution, {
7083
7135
  ...props,
7084
7136
  key: `${props.sessionId}:${turn.turn}`,
@@ -7089,16 +7141,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7089
7141
  diagnostic
7090
7142
  });
7091
7143
  }
7092
- const removeProjections = capabilities.uiConversation === void 0 ? noop$2 : installAutoModelProjections({
7144
+ const removeProjections = capabilities.uiConversation === void 0 ? noop$3 : installAutoModelProjections({
7093
7145
  uiConversation: capabilities.uiConversation,
7094
7146
  diagnostic
7095
7147
  });
7096
- let removeInjection = noop$2;
7148
+ let removeInjection = noop$3;
7097
7149
  try {
7098
7150
  removeInjection = slots.inject(SLOT, () => {
7099
7151
  if (slots.spec(SLOT)?.kind !== "list" || slots.spec(SLOT)?.scope !== "session") {
7100
7152
  diagnostic("COPILOT_AUTO_ACTIONS_SLOT_UNAVAILABLE");
7101
- return noop$2;
7153
+ return noop$3;
7102
7154
  }
7103
7155
  return slots.register({
7104
7156
  name: SLOT,
@@ -7110,7 +7162,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7110
7162
  removeInjection();
7111
7163
  removeProjections();
7112
7164
  diagnostic("COPILOT_AUTO_PRESENTATION_FAILED");
7113
- return noop$2;
7165
+ return noop$3;
7114
7166
  }
7115
7167
  return () => {
7116
7168
  removeInjection();
@@ -7218,7 +7270,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7218
7270
  overflowWrap: "anywhere",
7219
7271
  margin: 0
7220
7272
  };
7221
- function record$2(value) {
7273
+ function record$3(value) {
7222
7274
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : {};
7223
7275
  }
7224
7276
  function revisionOf(value) {
@@ -7228,7 +7280,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7228
7280
  return id === GITHUB_COPILOT_SEARCH_PROVIDER ? "GitHub Copilot" : id === DEEPSEEK_SEARCH_PROVIDER ? "DeepSeek" : id;
7229
7281
  }
7230
7282
  function saveFailure(error) {
7231
- const code = record$2(error).code;
7283
+ const code = record$3(error).code;
7232
7284
  if (code === "settings-conflict") return "Search settings changed since you opened this page. Reload settings, then review and save your choices again.";
7233
7285
  if (code === "settings-rejected") return "The settings service rejected this change. Reload settings to check whether editing is available, then try again.";
7234
7286
  return "Could not confirm the save. Reload settings to check saved values before retrying. Your current choices have been kept.";
@@ -7247,7 +7299,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7247
7299
  const timeoutLimit = 2147483647;
7248
7300
  function searchOptions(value) {
7249
7301
  if (typeof value !== "object" || value === null || Array.isArray(value)) return void 0;
7250
- const source = record$2(value);
7302
+ const source = record$3(value);
7251
7303
  const options = {
7252
7304
  ...searchDefaults,
7253
7305
  ...source
@@ -7521,9 +7573,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7521
7573
  }
7522
7574
  const copilot = result.value.namespaces.find((entry) => entry.ns === GITHUB_COPILOT_SETTINGS_NAMESPACE);
7523
7575
  const legacyRouting = result.value.namespaces.find((entry) => entry.ns === WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE);
7524
- const copilotValue = record$2(copilot?.value);
7525
- const copilotRoutingValue = record$2(copilotValue.searchRouting);
7526
- const legacyRoutingValue = record$2(legacyRouting?.value);
7576
+ const copilotValue = record$3(copilot?.value);
7577
+ const copilotRoutingValue = record$3(copilotValue.searchRouting);
7578
+ const legacyRoutingValue = record$3(legacyRouting?.value);
7527
7579
  const routingValue = Object.keys(copilotRoutingValue).length > 0 ? copilotRoutingValue : legacyRoutingValue;
7528
7580
  const normalized = normalizeWebSearchRouting({
7529
7581
  searchProvider: typeof routingValue.searchProvider === "string" ? routingValue.searchProvider : void 0,
@@ -8435,25 +8487,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8435
8487
  //#endregion
8436
8488
  //#region lib/types/copilot-usage-ui.js
8437
8489
  const slot$1 = "conversation.composer.dock";
8438
- const noop$1 = () => {};
8439
- const emptySubscribe = () => noop$1;
8440
- function record$1(value) {
8490
+ const noop$2 = () => {};
8491
+ const emptySubscribe = () => noop$2;
8492
+ function record$2(value) {
8441
8493
  return typeof value === "object" && value !== null;
8442
8494
  }
8443
- function isSlots$1(value) {
8444
- return record$1(value) && typeof value.spec === "function" && typeof value.inject === "function" && typeof value.register === "function";
8495
+ function isSlots$2(value) {
8496
+ return record$2(value) && typeof value.spec === "function" && typeof value.inject === "function" && typeof value.register === "function";
8445
8497
  }
8446
8498
  function isRemote(value) {
8447
- return record$1(value) && typeof value.get === "function" && typeof value.refresh === "function";
8499
+ return record$2(value) && typeof value.get === "function" && typeof value.refresh === "function";
8448
8500
  }
8449
- function isLocale$1(value) {
8450
- return record$1(value) && typeof value.getLocale === "function" && typeof value.subscribe === "function";
8501
+ function isLocale$2(value) {
8502
+ return record$2(value) && typeof value.getLocale === "function" && typeof value.subscribe === "function";
8451
8503
  }
8452
- function isRuntime$1(value) {
8453
- return record$1(value) && typeof value.sessionId === "string" && value.sessionId !== "" && typeof value.useSession === "function" && typeof value.useProjection === "function";
8504
+ function isRuntime$2(value) {
8505
+ return record$2(value) && typeof value.sessionId === "string" && value.sessionId !== "" && typeof value.useSession === "function" && typeof value.useProjection === "function";
8454
8506
  }
8455
8507
  function selection(value) {
8456
- return record$1(value) && typeof value.provider === "string" && value.provider.trim() !== "" && typeof value.model === "string" && value.model.trim() !== "";
8508
+ return record$2(value) && typeof value.provider === "string" && value.provider.trim() !== "" && typeof value.model === "string" && value.model.trim() !== "";
8457
8509
  }
8458
8510
  /**
8459
8511
  * Verified alpha.2 wire projection: next = pending ?? lastUsed; lastUsed is
@@ -8461,13 +8513,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8461
8513
  * catalog. A blank Session without explicit selection waits for that evidence.
8462
8514
  */
8463
8515
  function effectiveCopilot(projection) {
8464
- if (!record$1(projection) || !(projection.lastUsed === null || selection(projection.lastUsed)) || !(projection.next === null || selection(projection.next))) return void 0;
8516
+ if (!record$2(projection) || !(projection.lastUsed === null || selection(projection.lastUsed)) || !(projection.next === null || selection(projection.next))) return void 0;
8465
8517
  const next = projection.next;
8466
8518
  if (!selection(next)) return void 0;
8467
8519
  return next.provider === "github-copilot" || next.provider === "github-copilot-preview" ? next : void 0;
8468
8520
  }
8469
- function Surface$1({ runtime, remote, locale, diagnostic }) {
8470
- const valid = runtime.useSession((session) => record$1(session) && session.sessionId === runtime.sessionId && session.removed === false && session.openState === "open");
8521
+ function Surface$2({ runtime, remote, locale, diagnostic }) {
8522
+ const valid = runtime.useSession((session) => record$2(session) && session.sessionId === runtime.sessionId && session.removed === false && session.openState === "open");
8471
8523
  const projection = runtime.useProjection("modelSelection");
8472
8524
  const language = (0, react.useSyncExternalStore)(locale === void 0 ? emptySubscribe : (listener) => locale.subscribe(listener), () => locale?.getLocale().active ?? "en", () => "en");
8473
8525
  const current = effectiveCopilot(projection);
@@ -8497,33 +8549,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8497
8549
  }
8498
8550
  };
8499
8551
  const candidate = ctx.slots;
8500
- if (!isSlots$1(candidate)) {
8552
+ if (!isSlots$2(candidate)) {
8501
8553
  diagnostic("COPILOT_USAGE_SLOT_UNAVAILABLE");
8502
- return noop$1;
8554
+ return noop$2;
8503
8555
  }
8504
8556
  const slots = candidate;
8505
8557
  let remote;
8506
8558
  try {
8507
8559
  const namespaces = ctx.remote;
8508
- const face = record$1(namespaces) ? namespaces.githubCopilotUsage : void 0;
8560
+ const face = record$2(namespaces) ? namespaces.githubCopilotUsage : void 0;
8509
8561
  if (isRemote(face)) remote = face;
8510
8562
  else diagnostic("COPILOT_USAGE_REMOTE_UNAVAILABLE");
8511
8563
  } catch {
8512
8564
  diagnostic("COPILOT_USAGE_REMOTE_UNAVAILABLE");
8513
8565
  }
8514
8566
  const localeCandidate = ctx.get("locale");
8515
- const locale = isLocale$1(localeCandidate) ? localeCandidate : void 0;
8567
+ const locale = isLocale$2(localeCandidate) ? localeCandidate : void 0;
8516
8568
  let active = true;
8517
8569
  let remove;
8518
- let injection = noop$1;
8570
+ let injection = noop$2;
8519
8571
  try {
8520
8572
  if (slots.spec(slot$1) === void 0) diagnostic("COPILOT_USAGE_SLOT_UNAVAILABLE");
8521
8573
  injection = slots.inject(slot$1, () => {
8522
- if (!active) return noop$1;
8574
+ if (!active) return noop$2;
8523
8575
  const spec = slots.spec(slot$1);
8524
8576
  if (spec?.kind !== "list" || spec.scope !== "session") {
8525
8577
  diagnostic("COPILOT_USAGE_SLOT_UNAVAILABLE");
8526
- return noop$1;
8578
+ return noop$2;
8527
8579
  }
8528
8580
  try {
8529
8581
  const dispose = slots.register({
@@ -8531,11 +8583,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8531
8583
  id: "github-copilot-usage",
8532
8584
  order: 20
8533
8585
  }, (props) => {
8534
- if (!isRuntime$1(props)) {
8586
+ if (!isRuntime$2(props)) {
8535
8587
  diagnostic("COPILOT_USAGE_SESSION_RUNTIME_UNAVAILABLE");
8536
8588
  return null;
8537
8589
  }
8538
- return (0, react.createElement)(Surface$1, {
8590
+ return (0, react.createElement)(Surface$2, {
8539
8591
  runtime: props,
8540
8592
  remote,
8541
8593
  locale,
@@ -8553,7 +8605,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8553
8605
  return cleanup;
8554
8606
  } catch {
8555
8607
  diagnostic("COPILOT_USAGE_SLOT_UNAVAILABLE");
8556
- return noop$1;
8608
+ return noop$2;
8557
8609
  }
8558
8610
  });
8559
8611
  } catch {
@@ -8602,18 +8654,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8602
8654
  //#endregion
8603
8655
  //#region lib/types/context-evidence-ui.js
8604
8656
  const slot = "conversation.composer.dock";
8605
- const noop = () => {};
8606
- function record(value) {
8657
+ const noop$1 = () => {};
8658
+ function record$1(value) {
8607
8659
  return typeof value === "object" && value !== null && !Array.isArray(value);
8608
8660
  }
8609
- function isSlots(value) {
8610
- return record(value) && typeof value.spec === "function" && typeof value.inject === "function" && typeof value.register === "function";
8661
+ function isSlots$1(value) {
8662
+ return record$1(value) && typeof value.spec === "function" && typeof value.inject === "function" && typeof value.register === "function";
8611
8663
  }
8612
- function isLocale(value) {
8613
- return record(value) && typeof value.getLocale === "function" && typeof value.subscribe === "function";
8664
+ function isLocale$1(value) {
8665
+ return record$1(value) && typeof value.getLocale === "function" && typeof value.subscribe === "function";
8614
8666
  }
8615
- function isRuntime(value) {
8616
- return record(value) && typeof value.sessionId === "string" && value.sessionId !== "" && typeof value.useSession === "function" && typeof value.useProjection === "function";
8667
+ function isRuntime$1(value) {
8668
+ return record$1(value) && typeof value.sessionId === "string" && value.sessionId !== "" && typeof value.useSession === "function" && typeof value.useProjection === "function";
8617
8669
  }
8618
8670
  const copy = {
8619
8671
  en: {
@@ -8652,16 +8704,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8652
8704
  color: "var(--dsw-alias-label-tertiary, GrayText)"
8653
8705
  } }, text.title), (0, react.createElement)("p", { style: { marginBlock: "0.5rem" } }, evidence === void 0 ? text.missing : evidence.reason === "unknown" ? text.unknown : text.explanation), sample ? (0, react.createElement)("p", { style: { marginBlock: "0.5rem" } }, `${text.sample}: ${new Intl.NumberFormat(locale.startsWith("zh") ? "zh-CN" : "en-US").format(sample.tokens)} tokens`) : null, evidence === void 0 ? null : (0, react.createElement)("p", { style: { marginBlock: "0.5rem" } }, sample ? text.historical : text.revoked));
8654
8706
  }
8655
- function Surface({ runtime, locale, diagnostic }) {
8656
- const valid = runtime.useSession((value) => record(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
8707
+ function Surface$1({ runtime, locale, diagnostic }) {
8708
+ const valid = runtime.useSession((value) => record$1(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
8657
8709
  const selection = runtime.useProjection("modelSelection");
8658
8710
  const raw = runtime.useProjection(COPILOT_CONTEXT_EVIDENCE);
8659
- const language = (0, react.useSyncExternalStore)((listener) => locale?.subscribe(listener) ?? noop, () => locale?.getLocale().active ?? "en", () => "en");
8711
+ const language = (0, react.useSyncExternalStore)((listener) => locale?.subscribe(listener) ?? noop$1, () => locale?.getLocale().active ?? "en", () => "en");
8660
8712
  const parsed = ContextEvidenceSchema.safeParse(raw);
8661
8713
  (0, react.useEffect)(() => {
8662
8714
  if (!parsed.success) diagnostic("COPILOT_CONTEXT_PROJECTION_UNAVAILABLE");
8663
8715
  }, [parsed.success, diagnostic]);
8664
- if (!valid || !record(selection) || !record(selection.next)) return null;
8716
+ if (!valid || !record$1(selection) || !record$1(selection.next)) return null;
8665
8717
  const next = selection.next;
8666
8718
  if (next.provider !== "github-copilot" && next.provider !== "github-copilot-preview") return null;
8667
8719
  const evidence = parsed.success ? parsed.data : void 0;
@@ -8683,28 +8735,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8683
8735
  }
8684
8736
  };
8685
8737
  const slots = ctx.get("slots");
8686
- if (!isSlots(slots)) {
8738
+ if (!isSlots$1(slots)) {
8687
8739
  diagnostic("COPILOT_CONTEXT_SLOT_UNAVAILABLE");
8688
- return noop;
8740
+ return noop$1;
8689
8741
  }
8690
8742
  const candidate = ctx.get("locale");
8691
- const locale = isLocale(candidate) ? candidate : void 0;
8743
+ const locale = isLocale$1(candidate) ? candidate : void 0;
8692
8744
  return slots.inject(slot, () => {
8693
8745
  const spec = slots.spec(slot);
8694
8746
  if (spec?.kind !== "list" || spec.scope !== "session") {
8695
8747
  diagnostic("COPILOT_CONTEXT_SLOT_UNAVAILABLE");
8696
- return noop;
8748
+ return noop$1;
8697
8749
  }
8698
8750
  return slots.register({
8699
8751
  name: slot,
8700
8752
  id: "github-copilot-context-evidence",
8701
8753
  order: 25
8702
8754
  }, (props) => {
8703
- if (!isRuntime(props)) {
8755
+ if (!isRuntime$1(props)) {
8704
8756
  diagnostic("COPILOT_CONTEXT_SESSION_RUNTIME_UNAVAILABLE");
8705
8757
  return null;
8706
8758
  }
8707
- return (0, react.createElement)(Surface, {
8759
+ return (0, react.createElement)(Surface$1, {
8708
8760
  runtime: props,
8709
8761
  locale,
8710
8762
  diagnostic
@@ -8713,6 +8765,147 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8713
8765
  });
8714
8766
  }
8715
8767
  //#endregion
8768
+ //#region lib/types/replay-recovery-ui.js
8769
+ const noop = () => {};
8770
+ function record(value) {
8771
+ return value !== null && typeof value === "object" && !Array.isArray(value);
8772
+ }
8773
+ function ReplayRecoveryCard({ sessionId, remote, locale = "en" }) {
8774
+ const zh = locale.startsWith("zh");
8775
+ const [view, setView] = (0, react.useState)();
8776
+ const [busy, setBusy] = (0, react.useState)(false);
8777
+ const [error, setError] = (0, react.useState)(false);
8778
+ const [confirm, setConfirm] = (0, react.useState)(false);
8779
+ const pending = (0, react.useRef)(false);
8780
+ const mounted = (0, react.useRef)(true);
8781
+ (0, react.useEffect)(() => {
8782
+ mounted.current = true;
8783
+ return () => {
8784
+ mounted.current = false;
8785
+ };
8786
+ }, []);
8787
+ const perform = async (enabled) => {
8788
+ if (pending.current) return;
8789
+ pending.current = true;
8790
+ setBusy(true);
8791
+ setError(false);
8792
+ setConfirm(false);
8793
+ try {
8794
+ const result = enabled === void 0 ? await remote.get(sessionId) : view && view.state !== "unavailable" ? await remote.setEnabled(sessionId, view.revision, enabled) : void 0;
8795
+ const parsed = result?.ok ? ReplayRecoveryViewSchema.safeParse(result.value) : void 0;
8796
+ if (!mounted.current) return;
8797
+ if (parsed?.success) setView(parsed.data);
8798
+ else {
8799
+ setView(void 0);
8800
+ setError(true);
8801
+ }
8802
+ } catch {
8803
+ if (mounted.current) {
8804
+ setView(void 0);
8805
+ setError(true);
8806
+ }
8807
+ } finally {
8808
+ pending.current = false;
8809
+ if (mounted.current) setBusy(false);
8810
+ }
8811
+ };
8812
+ const button = {
8813
+ font: "inherit",
8814
+ color: "inherit",
8815
+ background: "transparent",
8816
+ border: "1px solid var(--dsw-alias-border-main, GrayText)",
8817
+ borderRadius: 6,
8818
+ padding: "6px 10px"
8819
+ };
8820
+ return (0, react.createElement)("details", {
8821
+ style: {
8822
+ maxWidth: "min(100%, 38rem)",
8823
+ overflowWrap: "anywhere"
8824
+ },
8825
+ onToggle: (event) => {
8826
+ if (event.currentTarget.open && view === void 0 && !busy && !error) perform();
8827
+ }
8828
+ }, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, zh ? "回放恢复" : "Replay recovery"), (0, react.createElement)("p", null, zh ? "仅用于 Copilot 的旧加密推理回放被拒绝。不会处理 408、额度或上下文超限。" : "For rejected old Copilot encrypted reasoning only. Not a remedy for 408, quota or context limits."), busy ? (0, react.createElement)("p", { role: "status" }, zh ? "正在处理…" : "Working…") : null, error ? (0, react.createElement)("p", { role: "alert" }, zh ? "无法读取或更改恢复状态。请等当前轮结束后重新读取;旧确认可能已过期。" : "Recovery could not be read or changed. Wait for the active turn to end and read again; the prior confirmation may have expired.") : null, view?.state === "unavailable" ? (0, react.createElement)("p", null, zh ? "没有当前可用的失败证据。仅保留本次 Host 运行中、同一账号验证状态下最近一小时的证据。" : "No current failure evidence. Evidence lasts at most one hour in this Host under the same account validation state.") : null, view && view.state !== "unavailable" ? (0, react.createElement)("div", null, (0, react.createElement)("p", null, zh ? `${view.model}:${view.itemCount} 条旧加密推理项。${view.state === "enabled" ? "恢复已启用。" : "默认保留完整回放。"}` : `${view.model}: ${view.itemCount} old encrypted reasoning items. ${view.state === "enabled" ? "Recovery enabled." : "Full replay is retained by default."}`), (0, react.createElement)("p", null, zh ? "启用后,仅本会话后续请求跳过这些已识别的旧项,包括对应隐藏推理状态及项内摘要。磁盘历史、界面可见消息及工具调用保持不变;新推理照常保留。不会自动重试或发送消息。关闭只影响后续请求,不能撤销已生成的回答。" : "Enabling skips these identified old items only on later requests in this session, including their hidden reasoning state and item summaries. Stored history, displayed messages and tool calls stay unchanged; new reasoning is retained. No retry or message is sent automatically. Disabling affects later requests and cannot undo generated answers."), confirm ? (0, react.createElement)("div", null, (0, react.createElement)("p", null, zh ? "确认接受上述隐藏推理状态损失?" : "Accept the hidden-reasoning loss described above?"), (0, react.createElement)("button", {
8829
+ type: "button",
8830
+ style: button,
8831
+ disabled: busy,
8832
+ onClick: () => void perform(true)
8833
+ }, zh ? "接受损失并启用" : "Accept loss and enable"), (0, react.createElement)("button", {
8834
+ type: "button",
8835
+ style: button,
8836
+ disabled: busy,
8837
+ onClick: () => setConfirm(false)
8838
+ }, zh ? "取消" : "Cancel")) : (0, react.createElement)("button", {
8839
+ type: "button",
8840
+ style: button,
8841
+ disabled: busy,
8842
+ onClick: () => view.state === "enabled" ? void perform(false) : setConfirm(true)
8843
+ }, view.state === "enabled" ? zh ? "关闭恢复" : "Disable recovery" : zh ? "查看启用确认" : "Review activation")) : null, (0, react.createElement)("button", {
8844
+ type: "button",
8845
+ style: {
8846
+ ...button,
8847
+ marginBlock: 8
8848
+ },
8849
+ disabled: busy,
8850
+ onClick: () => void perform()
8851
+ }, zh ? "重新读取状态" : "Read status again"));
8852
+ }
8853
+ function isSlots(value) {
8854
+ return record(value) && typeof value.spec === "function" && typeof value.inject === "function" && typeof value.register === "function";
8855
+ }
8856
+ function isLocale(value) {
8857
+ return record(value) && typeof value.getLocale === "function" && typeof value.subscribe === "function";
8858
+ }
8859
+ function isRuntime(value) {
8860
+ return record(value) && typeof value.sessionId === "string" && value.sessionId !== "" && typeof value.useSession === "function" && typeof value.useProjection === "function";
8861
+ }
8862
+ function Surface({ runtime, remote, locale }) {
8863
+ const valid = runtime.useSession((value) => record(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
8864
+ const selected = runtime.useProjection("modelSelection");
8865
+ const language = (0, react.useSyncExternalStore)((listener) => locale?.subscribe(listener) ?? noop, () => locale?.getLocale().active ?? "en", () => "en");
8866
+ if (!valid || !record(selected) || !record(selected.next) || selected.next.provider !== "github-copilot-preview") return null;
8867
+ return (0, react.createElement)(ReplayRecoveryCard, {
8868
+ key: runtime.sessionId,
8869
+ sessionId: runtime.sessionId,
8870
+ remote,
8871
+ locale: language
8872
+ });
8873
+ }
8874
+ function registerReplayRecoveryUi(ctx) {
8875
+ const candidate = ctx.get("slots");
8876
+ if (!isSlots(candidate)) {
8877
+ ctx.logger.warn("COPILOT_REPLAY_RECOVERY_SLOT_UNAVAILABLE");
8878
+ return noop;
8879
+ }
8880
+ const slots = candidate;
8881
+ const remote = ctx.remote.githubCopilotReplayRecovery;
8882
+ const language = ctx.get("locale");
8883
+ const locale = isLocale(language) ? language : void 0;
8884
+ const name = "conversation.composer.dock";
8885
+ return slots.inject(name, () => {
8886
+ const spec = slots.spec(name);
8887
+ if (spec?.kind !== "list" || spec.scope !== "session") {
8888
+ ctx.logger.warn("COPILOT_REPLAY_RECOVERY_SLOT_UNAVAILABLE");
8889
+ return noop;
8890
+ }
8891
+ return slots.register({
8892
+ name,
8893
+ id: "github-copilot-replay-recovery",
8894
+ order: 30
8895
+ }, (props) => {
8896
+ if (!isRuntime(props)) {
8897
+ ctx.logger.warn("COPILOT_REPLAY_RECOVERY_SESSION_UNAVAILABLE");
8898
+ return null;
8899
+ }
8900
+ return (0, react.createElement)(Surface, {
8901
+ runtime: props,
8902
+ remote,
8903
+ locale
8904
+ });
8905
+ });
8906
+ });
8907
+ }
8908
+ //#endregion
8716
8909
  //#region lib/types/model-preferences-card.js
8717
8910
  const controlStyle = {
8718
8911
  color: "inherit",
@@ -10014,6 +10207,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10014
10207
  ], registerSearchUi);
10015
10208
  const usageUi = ctx.inject(["remote.githubCopilotUsage", "slots"], registerCopilotUsageUi);
10016
10209
  const contextUi = ctx.inject(["slots"], registerContextEvidenceUi);
10210
+ const recoveryUi = ctx.inject(["remote.githubCopilotReplayRecovery", "slots"], registerReplayRecoveryUi);
10017
10211
  const autoUi = ctx.inject(["remote.githubCopilotTurnSelection", "slots"], (scope) => installAutoModelPresentation({
10018
10212
  slots: scope.slots,
10019
10213
  remote: scope.remote,
@@ -10036,6 +10230,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10036
10230
  };
10037
10231
  });
10038
10232
  return async () => {
10233
+ await recoveryUi.dispose();
10039
10234
  await contextUi.dispose();
10040
10235
  await usageUi.dispose();
10041
10236
  await autoUi.dispose();