dsh-github-copilot 0.4.0-alpha.108 → 0.4.0-alpha.109

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$1
5492
5492
  }).strict();
5493
5493
  const DualModelCreateResultSchema = object({ sessionId: id }).strict();
5494
- const contribution$7 = {
5494
+ const contribution$8 = {
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$6 = {
5542
+ const contribution$7 = {
5543
5543
  package: "dsh-github-copilot",
5544
5544
  descriptors: [{
5545
5545
  id: "dsh-github-copilot:githubCopilotSearchRouting.providers",
@@ -5667,7 +5667,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5667
5667
  if (view.remaining !== void 0 && view.percentUsed !== void 0 && Math.abs((1 - view.remaining / view.limit) * 100 - view.percentUsed) > 1) invalid();
5668
5668
  }
5669
5669
  });
5670
- const contribution$5 = {
5670
+ const contribution$6 = {
5671
5671
  package: "dsh-github-copilot",
5672
5672
  descriptors: ["get", "refresh"].map((method) => ({
5673
5673
  id: `dsh-github-copilot:githubCopilotUsage.${method}`,
@@ -5809,7 +5809,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5809
5809
  }).strict();
5810
5810
  //#endregion
5811
5811
  //#region lib/types/turn-selection-remote.js
5812
- const contribution$4 = {
5812
+ const contribution$5 = {
5813
5813
  package: "dsh-github-copilot",
5814
5814
  descriptors: [{
5815
5815
  id: "dsh-github-copilot:githubCopilotTurnSelection.get",
@@ -5871,7 +5871,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5871
5871
  lookup: "agent",
5872
5872
  codec: strictRemoteCodec("@deepseek-ai/dsh-session/types#SessionId", string().min(1).max(256))
5873
5873
  };
5874
- const contribution$3 = {
5874
+ const contribution$4 = {
5875
5875
  package: "dsh-github-copilot",
5876
5876
  descriptors: [
5877
5877
  {
@@ -5979,7 +5979,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5979
5979
  if (row.identity !== void 0 && !row.configured) invalid();
5980
5980
  }
5981
5981
  });
5982
- const contribution$2 = {
5982
+ const contribution$3 = {
5983
5983
  package: "dsh-github-copilot",
5984
5984
  descriptors: [
5985
5985
  "get",
@@ -6032,7 +6032,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6032
6032
  lookup: "agent",
6033
6033
  codec: strictRemoteCodec("@deepseek-ai/dsh-session/types#SessionId", string().min(1).max(256))
6034
6034
  };
6035
- const contribution$1 = {
6035
+ const contribution$2 = {
6036
6036
  package: "dsh-github-copilot",
6037
6037
  descriptors: [
6038
6038
  "get",
@@ -6067,6 +6067,63 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6067
6067
  result: method === "usage" || method === "refreshUsage" ? strictRemoteCodec("dsh-github-copilot#CopilotUsageView", CopilotUsageViewSchema) : method === "turn" ? strictRemoteCodec("dsh-github-copilot#TurnAccountView", TurnAccountViewSchema) : strictRemoteCodec("dsh-github-copilot#SessionAccountView", SessionAccountViewSchema)
6068
6068
  }))
6069
6069
  };
6070
+ array(object({
6071
+ sessionId: string().min(1).max(256).refine((value) => !/[\p{Cc}\p{Cf}]/u.test(value)),
6072
+ version: literal(1),
6073
+ consentedAt: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
6074
+ enabled: boolean().optional()
6075
+ }).strict()).max(2048).refine((rows) => new Set(rows.map((row) => row.sessionId)).size === rows.length);
6076
+ array(object({
6077
+ enabled: boolean(),
6078
+ changedAt: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)
6079
+ }).strict()).max(2048).refine((rows) => rows.every((row, index) => index === 0 || row.changedAt > rows[index - 1].changedAt));
6080
+ const ContinuationDefaultViewSchema = object({
6081
+ enabled: boolean(),
6082
+ revision: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)
6083
+ }).strict();
6084
+ const SessionContinuationViewSchema = object({
6085
+ enabled: boolean(),
6086
+ revision: number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
6087
+ activeTurnEnabled: boolean().optional(),
6088
+ source: _enum(["default", "session"]).optional(),
6089
+ nextTurnAuthorized: boolean().optional()
6090
+ }).strict();
6091
+ //#endregion
6092
+ //#region lib/types/session-continuation-remote.js
6093
+ const contribution$1 = {
6094
+ package: "dsh-github-copilot",
6095
+ descriptors: [
6096
+ "get",
6097
+ "set",
6098
+ "authorizeNext",
6099
+ "defaults",
6100
+ "setDefault"
6101
+ ].map((method) => ({
6102
+ id: `dsh-github-copilot:githubCopilotSessionContinuation.${method}`,
6103
+ namespace: "githubCopilotSessionContinuation",
6104
+ service: "githubCopilotSessionContinuation",
6105
+ method,
6106
+ invocation: { kind: "direct" },
6107
+ parameters: [...method === "defaults" || method === "setDefault" ? [] : [{
6108
+ name: "agent",
6109
+ wire: "agentId",
6110
+ source: "lookup",
6111
+ lookup: "agent",
6112
+ codec: strictRemoteCodec("@deepseek-ai/dsh-session/types#SessionId", string().min(1).max(256))
6113
+ }], ...method === "set" || method === "authorizeNext" || method === "setDefault" ? [{
6114
+ name: "revision",
6115
+ wire: "revision",
6116
+ source: "json",
6117
+ codec: strictRemoteCodec("dsh-github-copilot#SessionContinuationRevision", number().int().nonnegative().max(Number.MAX_SAFE_INTEGER))
6118
+ }, {
6119
+ name: "enabled",
6120
+ wire: "enabled",
6121
+ source: "json",
6122
+ codec: strictRemoteCodec("dsh-github-copilot#SessionContinuationEnabled", method === "set" ? boolean().nullable() : boolean())
6123
+ }] : []],
6124
+ result: method === "defaults" || method === "setDefault" ? strictRemoteCodec("dsh-github-copilot#ContinuationDefaultView", ContinuationDefaultViewSchema) : strictRemoteCodec("dsh-github-copilot#SessionContinuationView", SessionContinuationViewSchema)
6125
+ }))
6126
+ };
6070
6127
  //#endregion
6071
6128
  //#region lib/types/remote.js
6072
6129
  /**
@@ -6276,6 +6333,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6276
6333
  parameters: [],
6277
6334
  result: strictRemoteCodec(GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL, GitHubCopilotMigrationStatusSchema)
6278
6335
  },
6336
+ ...contribution$8.descriptors,
6279
6337
  ...contribution$7.descriptors,
6280
6338
  ...contribution$6.descriptors,
6281
6339
  ...contribution$5.descriptors,
@@ -8521,6 +8579,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8521
8579
  }
8522
8580
  //#endregion
8523
8581
  //#region lib/types/copilot-accounts-card.js
8582
+ function CopilotAccountAdd(props) {
8583
+ return (0, react.createElement)(CopilotAccountControls, {
8584
+ ...props,
8585
+ addOnly: true,
8586
+ expanded: true
8587
+ });
8588
+ }
8524
8589
  /** Copy owned presentation fields before decoding traced Client values. */
8525
8590
  function accountsViewFrom(value) {
8526
8591
  const record = (input) => {
@@ -8579,7 +8644,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8579
8644
  borderRadius: 8,
8580
8645
  padding: "6px 10px",
8581
8646
  minHeight: 32,
8582
- cursor: "pointer"
8647
+ cursor: "pointer",
8648
+ colorScheme: "inherit"
8583
8649
  };
8584
8650
  const muted$1 = {
8585
8651
  color: secondary$1,
@@ -8591,7 +8657,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8591
8657
  en: {
8592
8658
  identityChecking: "Checking GitHub identity…",
8593
8659
  identityUnavailable: "GitHub account identity unavailable",
8594
- accounts: "GitHub accounts",
8660
+ accounts: "Account management",
8661
+ searchAccounts: "Search saved GitHub accounts",
8662
+ noAccountsMatch: "No saved accounts match this search.",
8663
+ switchTo: (account) => `Switch to ${account}`,
8664
+ closeAccounts: "Close account list",
8595
8665
  scope: "Global default for new inherited turns. Credits can override this Session’s subsequent turns. Running turns, explicit Session accounts, models and conversation history stay unchanged.",
8596
8666
  remoteUnavailable: "Account management is unavailable in this deployment.",
8597
8667
  readFailed: "Could not read account information. Retry before changing accounts.",
@@ -8645,12 +8715,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8645
8715
  cancelling: "Cancelling…",
8646
8716
  add: "Add GitHub account",
8647
8717
  refresh: "Refresh account information",
8648
- refreshing: "Checking…"
8718
+ refreshing: "Checking…",
8719
+ retry: "Retry"
8649
8720
  },
8650
8721
  zh: {
8651
8722
  identityChecking: "正在检查 GitHub 身份…",
8652
8723
  identityUnavailable: "GitHub 账号身份暂不可用",
8653
- accounts: "GitHub 账号",
8724
+ accounts: "账号管理",
8725
+ searchAccounts: "搜索已保存的 GitHub 账号",
8726
+ noAccountsMatch: "没有匹配的已保存账号。",
8727
+ switchTo: (account) => `切换到 ${account}`,
8728
+ closeAccounts: "关闭账号列表",
8654
8729
  scope: "全局默认账号用于后续继承默认值的新 turn。Credits 可为本 Session 后续 turn 指定账号。正在运行的 turn、Session 已指定账号、模型和对话历史保持不变。",
8655
8730
  remoteUnavailable: "当前部署无法管理账号。",
8656
8731
  readFailed: "无法读取账号信息。更改账号前请重试。",
@@ -8704,7 +8779,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8704
8779
  cancelling: "正在取消…",
8705
8780
  add: "添加 GitHub 账号",
8706
8781
  refresh: "刷新账号信息",
8707
- refreshing: "正在检查…"
8782
+ refreshing: "正在检查…",
8783
+ retry: "重试"
8708
8784
  }
8709
8785
  };
8710
8786
  function accountProblemMessage(code, text) {
@@ -8730,6 +8806,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8730
8806
  }
8731
8807
  }
8732
8808
  function CopilotAccountsPanel(props) {
8809
+ return (0, react.createElement)(CopilotAccountControls, props);
8810
+ }
8811
+ function CopilotAccountControls(props) {
8812
+ const managementRemote = props.addOnly ? void 0 : props.remote;
8733
8813
  const [view, setView] = (0, react.useState)();
8734
8814
  const [busy, setBusy] = (0, react.useState)(false);
8735
8815
  const [failed, setFailed] = (0, react.useState)(false);
@@ -8737,13 +8817,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8737
8817
  const [cancelRequested, setCancelRequested] = (0, react.useState)(false);
8738
8818
  const [authorizationIntent, setAuthorizationIntent] = (0, react.useState)();
8739
8819
  const [confirmation, setConfirmation] = (0, react.useState)();
8820
+ const [accountsOpen, setAccountsOpen] = (0, react.useState)(false);
8821
+ const [accountSearch, setAccountSearch] = (0, react.useState)("");
8740
8822
  const lifetime = (0, react.useRef)({
8741
8823
  active: false,
8742
8824
  generation: 0,
8743
8825
  busy: false,
8744
8826
  copyGeneration: 0
8745
8827
  });
8828
+ const refreshed = (0, react.useRef)(props.refreshKey);
8746
8829
  const text = props.locale?.toLowerCase().startsWith("zh") ? accountCopy.zh : accountCopy.en;
8830
+ (0, react.useEffect)(() => {
8831
+ if (!props.expanded) {
8832
+ setAccountsOpen(false);
8833
+ setAccountSearch("");
8834
+ setConfirmation(void 0);
8835
+ }
8836
+ }, [props.expanded]);
8747
8837
  const run = (0, react.useCallback)(async (operation, changed = false, invalidate = changed) => {
8748
8838
  const owner = lifetime.current;
8749
8839
  if (!owner.active || owner.busy) return;
@@ -8789,7 +8879,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8789
8879
  setCopyState("idle");
8790
8880
  setCancelRequested(false);
8791
8881
  setAuthorizationIntent(void 0);
8792
- if (props.remote !== void 0 && !props.authorizationBusy) run(() => props.remote.ensureIdentity());
8882
+ if (props.remote !== void 0 && !props.authorizationBusy) {
8883
+ const remote = props.remote;
8884
+ run(() => managementRemote !== void 0 ? managementRemote.ensureIdentity() : remote.get());
8885
+ }
8793
8886
  return () => {
8794
8887
  owner.active = false;
8795
8888
  owner.generation++;
@@ -8797,14 +8890,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8797
8890
  };
8798
8891
  }, [
8799
8892
  props.remote,
8893
+ managementRemote,
8800
8894
  run,
8801
8895
  props.authorizationBusy,
8802
8896
  props.configured
8803
8897
  ]);
8804
8898
  (0, react.useEffect)(() => {
8805
- if (props.remote === void 0 || props.authorizationBusy || view?.operation !== void 0) return;
8899
+ if (refreshed.current === props.refreshKey || managementRemote === void 0 || busy || props.authorizationBusy) return;
8900
+ refreshed.current = props.refreshKey;
8901
+ setConfirmation(void 0);
8902
+ run(() => managementRemote.get());
8903
+ }, [
8904
+ props.refreshKey,
8905
+ managementRemote,
8906
+ busy,
8907
+ props.authorizationBusy,
8908
+ run
8909
+ ]);
8910
+ (0, react.useEffect)(() => {
8911
+ if (managementRemote === void 0 || props.authorizationBusy || view?.operation !== void 0) return;
8806
8912
  const ensure = () => {
8807
- if (document.visibilityState !== "hidden") run(() => props.remote.ensureIdentity());
8913
+ if (document.visibilityState !== "hidden") run(() => managementRemote.ensureIdentity());
8808
8914
  };
8809
8915
  const timer = window.setInterval(ensure, 6e4);
8810
8916
  document.addEventListener("visibilitychange", ensure);
@@ -8813,7 +8919,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8813
8919
  document.removeEventListener("visibilitychange", ensure);
8814
8920
  };
8815
8921
  }, [
8816
- props.remote,
8922
+ managementRemote,
8817
8923
  props.authorizationBusy,
8818
8924
  view?.operation,
8819
8925
  run
@@ -8867,13 +8973,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8867
8973
  run(() => props.remote.add(), true);
8868
8974
  };
8869
8975
  const startReauthorization = (accountId, revision) => {
8976
+ if (managementRemote === void 0) return;
8870
8977
  setAuthorizationIntent("reauthorize");
8871
8978
  setCancelRequested(false);
8872
- run(() => props.remote.reauthorize(accountId, revision), true);
8979
+ run(() => managementRemote.reauthorize(accountId, revision), true);
8873
8980
  };
8874
8981
  const identity = accountIdentityLabel(view);
8982
+ const activeAccount = view?.accounts.find((account) => account.id === view.activeAccountId);
8875
8983
  const selected = confirmation === void 0 ? void 0 : view?.accounts.find((item) => item.id === confirmation.id);
8876
8984
  const selectedLabel = selected?.identityState === "ready" && selected.identity !== void 0 ? `@${selected.identity.login}` : text.savedAuthorization;
8985
+ const normalizedSearch = accountSearch.trim().toLocaleLowerCase();
8986
+ const savedAccounts = (view?.accounts ?? []).filter((account) => {
8987
+ if (!normalizedSearch) return true;
8988
+ return `${(account.identityState === "ready" ? account.identity?.login : void 0) ?? ""} ${account.id}`.toLocaleLowerCase().includes(normalizedSearch);
8989
+ });
8877
8990
  const pending = busy || props.authorizationBusy === true || view?.operation !== void 0;
8878
8991
  const authorizationOperation = view?.operation === "authorizing" || view?.operation === "verifying";
8879
8992
  const authorizationStatus = cancelRequested ? text.cancelling : view?.operation === "authorizing" ? authorizationIntent === "add" ? noticeCode === void 0 ? text.addingStarting : text.addingWaiting : authorizationIntent === "reauthorize" ? noticeCode === void 0 ? text.reauthorizingStarting : text.reauthorizingWaiting : noticeCode === void 0 ? text.authorizationStarting : text.authorizationWaiting : view?.operation === "verifying" ? authorizationIntent === "add" ? text.verifyingAdding : authorizationIntent === "reauthorize" ? text.verifyingReauthorizing : text.verifying : view?.operation === "switching" ? text.switchingBusy : void 0;
@@ -8882,11 +8995,44 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8882
8995
  type: "button",
8883
8996
  style: {
8884
8997
  ...button$1,
8885
- cursor: disabled ? "default" : "pointer"
8998
+ cursor: disabled ? "not-allowed" : "pointer",
8999
+ color: disabled ? "var(--dsw-alias-label-secondary, GrayText)" : "inherit"
8886
9000
  },
8887
9001
  onClick,
8888
9002
  disabled
8889
9003
  }, label);
9004
+ const savedAccountItems = savedAccounts.map((account) => {
9005
+ const accountName = account.identityState === "ready" && account.identity !== void 0 ? `@${account.identity.login}` : text.savedAuthorization;
9006
+ return (0, react.createElement)("li", {
9007
+ key: account.id,
9008
+ "data-copilot-saved-account": account.id,
9009
+ style: {
9010
+ display: "flex",
9011
+ flexWrap: "wrap",
9012
+ alignItems: "center",
9013
+ gap: 8,
9014
+ paddingBlock: 10,
9015
+ borderBottom: border$1
9016
+ }
9017
+ }, (0, react.createElement)("div", { style: {
9018
+ minWidth: 0,
9019
+ flex: "1 1 140px"
9020
+ } }, (0, react.createElement)("strong", null, account.identityState === "ready" && account.identity !== void 0 ? accountName : account.configured ? text.identityUnavailableLabel : text.authorizationUnavailable), (0, react.createElement)("p", { style: muted$1 }, account.id === view?.activeAccountId ? text.currentDefault : account.configured ? text.savedAuthorization : text.authorizationUnavailable)), account.id === view?.activeAccountId ? null : control(text.switchTo(accountName), () => {
9021
+ if (view?.revision !== void 0) setConfirmation({
9022
+ id: account.id,
9023
+ revision: view.revision,
9024
+ remove: false
9025
+ });
9026
+ }, pending || view?.switchable !== true || view?.revision === void 0 || !account.configured), account.id === "canonical" || account.id === view?.activeAccountId ? null : control(text.reauthorize, () => {
9027
+ if (props.remote !== void 0 && view?.revision !== void 0) startReauthorization(account.id, view.revision);
9028
+ }, pending || view?.writable !== true || view?.switchable !== true || view?.revision === void 0), account.id === "canonical" || account.id === view?.activeAccountId ? null : control(text.remove, () => {
9029
+ if (view?.revision !== void 0) setConfirmation({
9030
+ id: account.id,
9031
+ revision: view.revision,
9032
+ remove: true
9033
+ });
9034
+ }, pending || view?.writable !== true || view?.revision === void 0));
9035
+ });
8890
9036
  return (0, react.createElement)("div", {
8891
9037
  "data-copilot-accounts": "",
8892
9038
  "aria-busy": pending,
@@ -8894,16 +9040,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8894
9040
  minWidth: 0,
8895
9041
  overflowWrap: "anywhere"
8896
9042
  }
8897
- }, (0, react.createElement)("p", {
9043
+ }, !props.expanded ? (0, react.createElement)("p", {
8898
9044
  style: muted$1,
8899
9045
  role: "status",
8900
9046
  "aria-live": "polite",
8901
9047
  "data-copilot-current-account": ""
8902
- }, identity ?? (busy ? text.identityChecking : text.identityUnavailable)), !props.expanded ? null : (0, react.createElement)("div", { style: {
8903
- display: "grid",
8904
- gap: 10,
8905
- marginBlock: 12
8906
- } }, (0, react.createElement)("strong", null, text.accounts), (0, react.createElement)("p", { style: muted$1 }, text.scope), props.remote === void 0 ? (0, react.createElement)("p", {
9048
+ }, identity ?? (busy ? text.identityChecking : text.identityUnavailable)) : null, !props.expanded ? null : (0, react.createElement)("section", {
9049
+ "data-copilot-account-management": props.addOnly ? void 0 : true,
9050
+ "data-copilot-account-add": props.addOnly ? true : void 0,
9051
+ "aria-label": props.addOnly ? text.add : text.accounts,
9052
+ style: {
9053
+ display: "grid",
9054
+ gap: 10,
9055
+ marginBlock: 12
9056
+ }
9057
+ }, props.addOnly ? null : (0, react.createElement)("h3", { style: {
9058
+ margin: 0,
9059
+ fontSize: 16
9060
+ } }, text.accounts), props.addOnly ? null : (0, react.createElement)("p", { style: muted$1 }, text.scope), props.remote === void 0 ? (0, react.createElement)("p", {
8907
9061
  role: "status",
8908
9062
  style: muted$1
8909
9063
  }, text.remoteUnavailable) : null, failed ? (0, react.createElement)("p", {
@@ -8971,41 +9125,71 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
8971
9125
  color: secondary$1,
8972
9126
  fontSize: 13
8973
9127
  }
8974
- }, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, text.technicalDetails), (0, react.createElement)("code", { style: { overflowWrap: "anywhere" } }, view.diagnostic)), (0, react.createElement)("ul", { style: {
8975
- padding: 0,
8976
- margin: 0,
8977
- listStyle: "none"
8978
- } }, ...(view?.accounts ?? []).map((account) => (0, react.createElement)("li", {
8979
- key: account.id,
9128
+ }, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, text.technicalDetails), (0, react.createElement)("code", { style: { overflowWrap: "anywhere" } }, view.diagnostic)), props.addOnly && !authorizationOperation ? control(text.add, () => {
9129
+ if (props.remote !== void 0) startAdd();
9130
+ }, pending || view?.writable !== true || view?.switchable !== true) : null, props.addOnly && (failed || !pending && view?.switchable === false) ? control(text.retry, () => {
9131
+ if (props.remote !== void 0) run(() => props.remote.get());
9132
+ }, pending || props.remote === void 0) : null, props.addOnly ? null : (0, react.createElement)("div", {
9133
+ "data-copilot-current-account-row": true,
8980
9134
  style: {
8981
9135
  display: "flex",
8982
9136
  flexWrap: "wrap",
8983
9137
  alignItems: "center",
8984
9138
  gap: 8,
8985
- paddingBlock: 10,
9139
+ paddingBlock: 8,
8986
9140
  borderBottom: border$1
8987
9141
  }
8988
9142
  }, (0, react.createElement)("div", { style: {
8989
9143
  minWidth: 0,
8990
9144
  flex: "1 1 180px"
8991
- } }, (0, react.createElement)("strong", null, account.identityState === "ready" && account.identity !== void 0 ? `@${account.identity.login}` : account.configured ? text.identityUnavailableLabel : text.authorizationUnavailable), (0, react.createElement)("p", { style: muted$1 }, account.id === view?.activeAccountId ? text.currentDefault : account.configured ? text.savedAuthorization : text.authorizationUnavailable)), account.id === view?.activeAccountId ? null : control(text.switch, () => {
8992
- if (view?.revision !== void 0) setConfirmation({
8993
- id: account.id,
8994
- revision: view.revision,
8995
- remove: false
8996
- });
8997
- }, pending || view?.switchable !== true || view?.revision === void 0 || !account.configured), account.id === "canonical" ? null : control(text.reauthorize, () => {
8998
- if (props.remote !== void 0 && view?.revision !== void 0) {
8999
- const revision = view.revision;
9000
- startReauthorization(account.id, revision);
9001
- }
9002
- }, pending || view?.writable !== true || view?.switchable !== true || view?.revision === void 0), account.id === "canonical" || account.id === view?.activeAccountId ? null : control(text.remove, () => {
9003
- if (view?.revision !== void 0) setConfirmation({
9004
- id: account.id,
9005
- revision: view.revision,
9006
- remove: true
9007
- });
9008
- }, pending || view?.writable !== true || view?.revision === void 0)))), confirmation === void 0 ? null : (0, react.createElement)("div", {
9145
+ } }, (0, react.createElement)("strong", {
9146
+ "data-copilot-current-account": "",
9147
+ role: "status",
9148
+ "aria-live": "polite"
9149
+ }, identity ?? text.identityUnavailableLabel), (0, react.createElement)("p", { style: muted$1 }, text.currentDefault)), control(accountsOpen ? text.closeAccounts : text.switch, () => {
9150
+ setAccountsOpen((open) => !open);
9151
+ setConfirmation(void 0);
9152
+ }, pending || view?.switchable !== true || view?.revision === void 0)), !props.addOnly && accountsOpen ? (0, react.createElement)("div", {
9153
+ "data-copilot-account-selector": true,
9154
+ style: {
9155
+ display: "grid",
9156
+ gap: 8
9157
+ }
9158
+ }, (0, react.createElement)("label", { style: {
9159
+ display: "grid",
9160
+ gap: 6,
9161
+ color: secondary$1,
9162
+ fontSize: 13
9163
+ } }, text.searchAccounts, (0, react.createElement)("input", {
9164
+ type: "search",
9165
+ value: accountSearch,
9166
+ "data-copilot-account-search": true,
9167
+ onChange: (event) => setAccountSearch(event.currentTarget.value),
9168
+ style: {
9169
+ ...button$1,
9170
+ fontSize: 16,
9171
+ width: "100%",
9172
+ boxSizing: "border-box",
9173
+ background: "var(--dsw-alias-bg-layer-1, Canvas)",
9174
+ color: "var(--dsw-alias-label-primary, CanvasText)"
9175
+ },
9176
+ placeholder: text.searchAccounts
9177
+ })), (0, react.createElement)("ul", {
9178
+ "data-copilot-saved-accounts": true,
9179
+ style: {
9180
+ padding: 0,
9181
+ margin: 0,
9182
+ listStyle: "none",
9183
+ maxHeight: 240,
9184
+ overflowY: "auto",
9185
+ overscrollBehavior: "contain"
9186
+ }
9187
+ }, ...savedAccountItems.length === 0 ? [(0, react.createElement)("li", {
9188
+ key: "no-matches",
9189
+ style: muted$1
9190
+ }, text.noAccountsMatch)] : savedAccountItems), authorizationOperation ? null : control(text.add, () => {
9191
+ if (props.remote !== void 0) startAdd();
9192
+ }, pending || view?.writable !== true || view?.switchable !== true)) : null, props.addOnly || confirmation === void 0 ? null : (0, react.createElement)("div", {
9009
9193
  role: "group",
9010
9194
  "aria-label": confirmation.remove ? text.confirmRemoveTitle : text.confirmSwitchTitle,
9011
9195
  style: {
@@ -9024,16 +9208,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9024
9208
  } }, control(confirmation.remove ? text.confirmRemove : text.confirmSwitch, () => {
9025
9209
  const target = confirmation;
9026
9210
  setConfirmation(void 0);
9027
- if (props.remote !== void 0) run(() => target.remove ? props.remote.removeAccount(target.id, target.revision) : props.remote.switchAccount(target.id, target.revision), true);
9028
- }, pending), control(text.cancel, () => setConfirmation(void 0), pending))), (0, react.createElement)("div", { style: {
9211
+ if (managementRemote !== void 0) run(() => target.remove ? managementRemote.removeAccount(target.id, target.revision) : managementRemote.switchAccount(target.id, target.revision), true);
9212
+ }, pending), control(text.cancel, () => setConfirmation(void 0), pending))), props.addOnly ? null : (0, react.createElement)("div", { style: {
9029
9213
  display: "flex",
9030
9214
  flexWrap: "wrap",
9031
9215
  gap: 8
9032
- } }, authorizationOperation ? null : control(text.add, () => {
9033
- if (props.remote !== void 0) startAdd();
9034
- }, pending || view?.writable !== true || view?.switchable !== true), control(busy ? text.refreshing : text.refresh, () => {
9035
- if (props.remote !== void 0) run(() => props.remote.refreshIdentity());
9036
- }, pending || props.remote === void 0))));
9216
+ } }, control(busy ? text.refreshing : text.refresh, () => {
9217
+ if (managementRemote !== void 0) run(() => managementRemote.refreshIdentity());
9218
+ }, pending || props.remote === void 0), activeAccount === void 0 || activeAccount.id === "canonical" ? null : control(text.reauthorize, () => {
9219
+ if (props.remote !== void 0 && view?.revision !== void 0) startReauthorization(activeAccount.id, view.revision);
9220
+ }, pending || view?.writable !== true || view?.switchable !== true || view?.revision === void 0)), props.accountSettings ?? null, props.continuationSettings ?? null));
9037
9221
  }
9038
9222
  //#endregion
9039
9223
  //#region lib/types/copilot-usage-card.js
@@ -9081,7 +9265,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9081
9265
  runningAccount: "Running turn remains on",
9082
9266
  identityUnknown: "Identity unavailable",
9083
9267
  originalAuthorization: "Original authorization",
9084
- savedAuthorization: "Saved authorization"
9268
+ savedAuthorization: "Saved authorization",
9269
+ nextAccount: "Next turn",
9270
+ searchAccounts: "Search saved accounts",
9271
+ cancel: "Cancel",
9272
+ noAccounts: "No matching accounts. Change your search or add an account.",
9273
+ savingAccount: "Saving account…",
9274
+ manage: "Manage accounts and models",
9275
+ confirmingAccount: "Reviewing account switch…",
9276
+ navigationUnavailable: "Account and model settings navigation is unavailable in this deployment."
9085
9277
  },
9086
9278
  zh: {
9087
9279
  credits: "额度",
@@ -9126,7 +9318,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9126
9318
  runningAccount: "正在运行的 turn 仍使用",
9127
9319
  identityUnknown: "身份暂不可用",
9128
9320
  originalAuthorization: "原始授权",
9129
- savedAuthorization: "已保存授权"
9321
+ savedAuthorization: "已保存授权",
9322
+ nextAccount: "下一轮",
9323
+ searchAccounts: "搜索已保存账号",
9324
+ cancel: "取消",
9325
+ noAccounts: "未找到匹配账号,请修改搜索或添加账号。",
9326
+ savingAccount: "正在保存账号…",
9327
+ manage: "管理账号与模型",
9328
+ confirmingAccount: "正在确认账号切换…",
9329
+ navigationUnavailable: "当前部署无法导航至账号与模型设置。"
9130
9330
  }
9131
9331
  };
9132
9332
  const secondary = "var(--dsw-alias-label-secondary, GrayText)";
@@ -9138,8 +9338,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9138
9338
  border,
9139
9339
  borderRadius: 8,
9140
9340
  background: "var(--dsw-alias-bg-layer-1, Canvas)",
9141
- padding: "5px 9px"
9341
+ padding: "5px 9px",
9342
+ colorScheme: "inherit"
9142
9343
  };
9344
+ const formStyles = `
9345
+ [data-copilot-usage-panel] :is(input, select, textarea, button) { color-scheme: inherit; }
9346
+ [data-copilot-usage-panel] option { background: Canvas; color: CanvasText; }
9347
+ [data-copilot-usage-panel] :is(input, select, textarea, button, a, summary):focus-visible {
9348
+ outline: 2px solid Highlight; outline-offset: 2px;
9349
+ }
9350
+ [data-copilot-usage-panel] :is(input, select, textarea, button):disabled { opacity: 0.65; }
9351
+ `;
9143
9352
  const muted = {
9144
9353
  color: secondary,
9145
9354
  fontSize: 12,
@@ -9174,7 +9383,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9174
9383
  const [accounts, setAccounts] = (0, react.useState)();
9175
9384
  const [sessionAccount, setSessionAccount] = (0, react.useState)();
9176
9385
  const [choosingAccount, setChoosingAccount] = (0, react.useState)(false);
9386
+ const [accountQuery, setAccountQuery] = (0, react.useState)("");
9177
9387
  const [savingAccount, setSavingAccount] = (0, react.useState)(false);
9388
+ const [confirmingAccount, setConfirmingAccount] = (0, react.useState)(false);
9178
9389
  const [accountFailed, setAccountFailed] = (0, react.useState)(false);
9179
9390
  const [accountSaveFailed, setAccountSaveFailed] = (0, react.useState)(false);
9180
9391
  const [busy, setBusy] = (0, react.useState)(false);
@@ -9187,15 +9398,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9187
9398
  const trigger = (0, react.useRef)(null);
9188
9399
  const panel = (0, react.useRef)(null);
9189
9400
  const closeButton = (0, react.useRef)(null);
9401
+ const switchButton = (0, react.useRef)(null);
9402
+ const accountSearch = (0, react.useRef)(null);
9190
9403
  const lifecycle = (0, react.useRef)({
9191
9404
  active: false,
9192
9405
  generation: 0,
9193
9406
  busy: false
9194
9407
  });
9195
9408
  const close = (0, react.useCallback)((restore = false) => {
9409
+ const owner = lifecycle.current;
9410
+ if (owner.confirmation !== void 0) {
9411
+ owner.generation++;
9412
+ owner.confirmation = void 0;
9413
+ owner.save = void 0;
9414
+ setConfirmingAccount(false);
9415
+ setSavingAccount(false);
9416
+ }
9417
+ owner.controller?.abort();
9418
+ owner.controller = void 0;
9196
9419
  setOpen(false);
9420
+ setChoosingAccount(false);
9421
+ setAccountQuery("");
9197
9422
  if (restore) trigger.current?.focus();
9198
9423
  }, []);
9424
+ const collapseAccounts = () => {
9425
+ setChoosingAccount(false);
9426
+ setAccountQuery("");
9427
+ switchButton.current?.focus();
9428
+ };
9199
9429
  const load = (0, react.useCallback)(async (force) => {
9200
9430
  const owner = lifecycle.current;
9201
9431
  if (!owner.active || owner.busy || owner.save !== void 0 || accountPresentationChanges.pending() || props.remote === void 0 || document.visibilityState === "hidden") return;
@@ -9262,7 +9492,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9262
9492
  setAccounts(void 0);
9263
9493
  setSessionAccount(void 0);
9264
9494
  setChoosingAccount(false);
9495
+ setAccountQuery("");
9265
9496
  setSavingAccount(false);
9497
+ setConfirmingAccount(false);
9266
9498
  setAccountFailed(false);
9267
9499
  setAccountSaveFailed(false);
9268
9500
  setFailed(false);
@@ -9280,7 +9512,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9280
9512
  owner.generation++;
9281
9513
  owner.busy = false;
9282
9514
  owner.save = void 0;
9515
+ owner.confirmation = void 0;
9516
+ owner.controller?.abort();
9517
+ owner.controller = void 0;
9283
9518
  setSavingAccount(false);
9519
+ setConfirmingAccount(false);
9284
9520
  setAccounts(void 0);
9285
9521
  setSessionAccount(void 0);
9286
9522
  setView(void 0);
@@ -9292,6 +9528,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9292
9528
  owner.active = false;
9293
9529
  owner.generation++;
9294
9530
  owner.busy = false;
9531
+ owner.save = void 0;
9532
+ owner.confirmation = void 0;
9533
+ owner.controller?.abort();
9534
+ owner.controller = void 0;
9295
9535
  if (timer !== void 0) window.clearInterval(timer);
9296
9536
  document.removeEventListener("visibilitychange", visible);
9297
9537
  unsubscribe();
@@ -9299,16 +9539,41 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9299
9539
  }, [load, props.remote]);
9300
9540
  const chooseAccount = async (accountId) => {
9301
9541
  const owner = lifecycle.current;
9302
- const revision = sessionAccount?.accounts.revision;
9542
+ let revision = sessionAccount?.accounts.revision;
9303
9543
  if (!owner.active || owner.save !== void 0 || props.sessionAccount === void 0 || revision === void 0) return;
9304
9544
  const save = Symbol();
9545
+ const controller = new AbortController();
9305
9546
  owner.save = save;
9547
+ owner.controller = controller;
9306
9548
  const generation = ++owner.generation;
9307
9549
  owner.busy = false;
9308
9550
  setBusy(false);
9309
9551
  setSavingAccount(true);
9310
9552
  setAccountSaveFailed(false);
9311
9553
  try {
9554
+ if (props.beforeAccountChange !== void 0) {
9555
+ owner.confirmation = save;
9556
+ setConfirmingAccount(true);
9557
+ const approved = await props.beforeAccountChange(accountId, controller.signal);
9558
+ if (!owner.active || owner.generation !== generation || owner.save !== save || controller.signal.aborted) return;
9559
+ if (approved !== true) return;
9560
+ const snapshot = await props.sessionAccount.get();
9561
+ if (!owner.active || owner.generation !== generation || owner.save !== save || controller.signal.aborted) return;
9562
+ const selection = snapshot.ok ? SessionAccountViewSchema.safeParse(snapshot.value) : void 0;
9563
+ if (!selection?.success || selection.data.accounts.revision === void 0) {
9564
+ setAccountSaveFailed(true);
9565
+ setView(void 0);
9566
+ setAccounts(void 0);
9567
+ setSessionAccount(void 0);
9568
+ return;
9569
+ }
9570
+ revision = selection.data.accounts.revision;
9571
+ setSessionAccount(selection.data);
9572
+ setAccounts(selection.data.accounts);
9573
+ setView(void 0);
9574
+ owner.confirmation = void 0;
9575
+ setConfirmingAccount(false);
9576
+ }
9312
9577
  const result = await props.sessionAccount.set(accountId, revision);
9313
9578
  if (!owner.active || owner.generation !== generation) return;
9314
9579
  const parsed = result.ok ? SessionAccountViewSchema.safeParse(result.value) : void 0;
@@ -9323,9 +9588,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9323
9588
  setAccounts(parsed.data.accounts);
9324
9589
  setView(void 0);
9325
9590
  setChoosingAccount(false);
9591
+ setAccountQuery("");
9326
9592
  owner.save = void 0;
9327
9593
  setSavingAccount(false);
9328
9594
  await load(false);
9595
+ if (owner.active && owner.generation === generation + 1) switchButton.current?.focus();
9329
9596
  } catch {
9330
9597
  if (owner.active && owner.generation === generation) {
9331
9598
  setAccountSaveFailed(true);
@@ -9334,9 +9601,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9334
9601
  setSessionAccount(void 0);
9335
9602
  }
9336
9603
  } finally {
9604
+ if (owner.controller === controller) owner.controller = void 0;
9337
9605
  if (owner.active && owner.save === save) {
9338
9606
  owner.save = void 0;
9607
+ owner.confirmation = void 0;
9339
9608
  setSavingAccount(false);
9609
+ setConfirmingAccount(false);
9340
9610
  }
9341
9611
  }
9342
9612
  };
@@ -9361,6 +9631,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9361
9631
  window.removeEventListener("scroll", place, true);
9362
9632
  };
9363
9633
  }, [open]);
9634
+ (0, react.useEffect)(() => {
9635
+ if (open && choosingAccount) accountSearch.current?.focus();
9636
+ }, [open, choosingAccount]);
9364
9637
  (0, react.useEffect)(() => {
9365
9638
  if (!open) return;
9366
9639
  const outside = (event) => {
@@ -9373,7 +9646,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9373
9646
  close(true);
9374
9647
  }
9375
9648
  if (event.key === "Tab" && panel.current?.contains(document.activeElement)) {
9376
- const buttons = Array.from(panel.current.querySelectorAll("button:not(:disabled),a[href],summary"));
9649
+ const buttons = Array.from(panel.current.querySelectorAll("button:not(:disabled),a[href],summary,input:not(:disabled),select:not(:disabled),textarea:not(:disabled)"));
9377
9650
  const target = event.shiftKey ? buttons.at(-1) : buttons[0];
9378
9651
  const edge = event.shiftKey ? buttons[0] : buttons.at(-1);
9379
9652
  if (document.activeElement === edge) {
@@ -9390,7 +9663,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9390
9663
  };
9391
9664
  }, [open, close]);
9392
9665
  const available = view?.state === "ready" || view?.state === "stale";
9393
- const unknownSavedAccounts = (sessionAccount?.accounts.accounts ?? []).filter((account) => account.configured && account.id !== "canonical" && account.identity === void 0);
9666
+ const unknownSavedAccounts = (open && choosingAccount ? sessionAccount?.accounts.accounts ?? [] : []).filter((account) => account.configured && account.id !== "canonical" && account.identity === void 0);
9394
9667
  const numberedUnknownAccounts = unknownSavedAccounts.length > 1 ? new Map(unknownSavedAccounts.map((account, index) => [account.id, index + 1])) : /* @__PURE__ */ new Map();
9395
9668
  const knownUnits = view?.billing === "credits" || view?.billing === "requests";
9396
9669
  const numbers = available && knownUnits;
@@ -9412,7 +9685,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9412
9685
  ].filter(Boolean).join(" · ")}${used === void 0 && remaining === void 0 ? ` · ${busy ? t.loading : t.unavailable}` : ""}`;
9413
9686
  const observed = available ? dateLabel(view.observedAt, language) : void 0;
9414
9687
  const reset = available && view.resetAt !== void 0 && view.observedAt !== void 0 && view.resetAt > view.observedAt ? dateLabel(view.resetAt, language) : void 0;
9415
- const runningIdentity = sessionAccount?.accounts.accounts.find((account) => account.id === sessionAccount.runningAccountId)?.identity;
9688
+ const currentIdentity = accountIdentityLabel(accounts) ?? t.identityUnavailable;
9689
+ const runningIdentity = sessionAccount?.runningAccountId === void 0 ? void 0 : accountIdentityLabel({
9690
+ ...sessionAccount.accounts,
9691
+ activeAccountId: sessionAccount.runningAccountId
9692
+ });
9693
+ const accountOptions = open && choosingAccount && sessionAccount ? [{
9694
+ id: null,
9695
+ label: t.followGlobal,
9696
+ selected: sessionAccount.source === "global"
9697
+ }, ...sessionAccount.accounts.accounts.filter((account) => account.configured).map((account) => ({
9698
+ id: account.id,
9699
+ label: account.identity ? `@${account.identity.login}` : account.id === "canonical" ? `${t.originalAuthorization} · ${t.identityUnknown}` : `${t.savedAuthorization}${numberedUnknownAccounts.has(account.id) ? ` ${numberedUnknownAccounts.get(account.id)}` : ""} · ${t.identityUnknown}`,
9700
+ selected: sessionAccount.source === "session" && sessionAccount.accountId === account.id
9701
+ }))].filter((option) => option.label.toLocaleLowerCase(language).includes(accountQuery.trim().toLocaleLowerCase(language))) : [];
9702
+ const navigationDiagnostic = props.navigationDiagnostic ?? "COPILOT_ACCOUNT_MANAGEMENT_NAVIGATION_UNAVAILABLE";
9416
9703
  return (0, react.createElement)("span", { style: {
9417
9704
  display: "inline-flex",
9418
9705
  minWidth: 0,
@@ -9427,7 +9714,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9427
9714
  "aria-expanded": open,
9428
9715
  "aria-controls": open ? id : void 0,
9429
9716
  onClick: () => {
9430
- setOpen((value) => !value);
9717
+ if (open) close();
9718
+ else setOpen(true);
9431
9719
  },
9432
9720
  style: {
9433
9721
  ...button,
@@ -9453,7 +9741,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9453
9741
  "aria-labelledby": `${id}-title`,
9454
9742
  "aria-describedby": `${id}-scope`,
9455
9743
  popover: "manual",
9744
+ "data-copilot-usage-panel": "",
9456
9745
  style: {
9746
+ colorScheme: "light dark",
9457
9747
  position: "fixed",
9458
9748
  inset: "auto",
9459
9749
  margin: 0,
@@ -9476,13 +9766,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9476
9766
  boxShadow: "0 8px 32px color-mix(in srgb, CanvasText 16%, transparent)",
9477
9767
  overflowWrap: "anywhere"
9478
9768
  }
9479
- }, (0, react.createElement)("div", { style: row }, (0, react.createElement)("div", null, (0, react.createElement)("strong", { id: `${id}-title` }, view?.billing === "credits" ? t.title : unit), (0, react.createElement)("p", {
9769
+ }, (0, react.createElement)("style", null, formStyles), (0, react.createElement)("div", { style: row }, (0, react.createElement)("div", null, (0, react.createElement)("strong", { id: `${id}-title` }, view?.billing === "credits" ? t.title : unit), (0, react.createElement)("p", {
9480
9770
  style: {
9481
9771
  ...muted,
9482
9772
  color: "inherit"
9483
9773
  },
9484
9774
  "data-copilot-credits-account": ""
9485
- }, accountIdentityLabel(accounts) ?? t.identityUnavailable), props.sessionAccount === void 0 ? null : (0, react.createElement)("p", {
9775
+ }, currentIdentity), props.sessionAccount === void 0 ? null : (0, react.createElement)("p", {
9486
9776
  style: muted,
9487
9777
  "data-copilot-account-source": ""
9488
9778
  }, sessionAccount === void 0 ? busy ? t.accountLoading : t.accountMissing : sessionAccount.source === "global" ? t.followGlobal : t.sessionSpecified), (0, react.createElement)("p", {
@@ -9497,6 +9787,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9497
9787
  close(true);
9498
9788
  }
9499
9789
  }, "×")), props.sessionAccount === void 0 ? null : (0, react.createElement)("div", { style: separator }, (0, react.createElement)("div", { style: row }, (0, react.createElement)("p", { style: muted }, t.switchScope), (0, react.createElement)("button", {
9790
+ ref: switchButton,
9500
9791
  type: "button",
9501
9792
  style: {
9502
9793
  ...button,
@@ -9504,42 +9795,79 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9504
9795
  },
9505
9796
  disabled: sessionAccount === void 0 || sessionAccount.accounts.revision === void 0 || busy || savingAccount,
9506
9797
  "aria-expanded": choosingAccount,
9507
- onClick: () => setChoosingAccount((value) => !value)
9508
- }, t.switchAccount)), sessionAccount?.runningAccountId === void 0 ? null : (0, react.createElement)("p", { style: muted }, `${t.runningAccount}: ${runningIdentity ? "@" + runningIdentity.login : t.identityUnknown}`), choosingAccount && sessionAccount ? (0, react.createElement)("div", {
9798
+ "aria-controls": choosingAccount ? `${id}-accounts` : void 0,
9799
+ onClick: () => {
9800
+ if (choosingAccount) collapseAccounts();
9801
+ else setChoosingAccount(true);
9802
+ }
9803
+ }, t.switchAccount)), sessionAccount?.runningAccountId === void 0 ? null : (0, react.createElement)("p", { style: muted }, `${t.runningAccount}: ${runningIdentity ?? t.identityUnknown} · ${t.nextAccount}: ${currentIdentity}`), choosingAccount ? (0, react.createElement)("div", {
9804
+ id: `${id}-accounts`,
9509
9805
  role: "group",
9510
9806
  "aria-label": t.switchAccount,
9807
+ "aria-busy": savingAccount,
9511
9808
  style: {
9512
9809
  display: "grid",
9513
- gap: 6,
9810
+ gap: 8,
9514
9811
  marginTop: 10
9515
9812
  }
9516
- }, (0, react.createElement)("button", {
9813
+ }, (0, react.createElement)("div", { style: row }, (0, react.createElement)("label", {
9814
+ htmlFor: `${id}-account-search`,
9815
+ style: muted
9816
+ }, t.searchAccounts), (0, react.createElement)("button", {
9517
9817
  type: "button",
9818
+ style: button,
9819
+ disabled: savingAccount,
9820
+ onClick: collapseAccounts
9821
+ }, t.cancel)), (0, react.createElement)("input", {
9822
+ ref: accountSearch,
9823
+ id: `${id}-account-search`,
9824
+ type: "search",
9825
+ "aria-label": t.searchAccounts,
9826
+ value: accountQuery,
9827
+ disabled: savingAccount,
9828
+ onChange: (event) => setAccountQuery(event.currentTarget.value),
9518
9829
  style: {
9519
9830
  ...button,
9520
- textAlign: "left"
9521
- },
9522
- disabled: savingAccount,
9523
- "aria-pressed": sessionAccount.source === "global",
9524
- onClick: () => {
9525
- chooseAccount(null);
9831
+ cursor: "text",
9832
+ width: "100%",
9833
+ minWidth: 0,
9834
+ boxSizing: "border-box"
9526
9835
  }
9527
- }, t.followGlobal), ...sessionAccount.accounts.accounts.filter((account) => account.configured).map((account) => (0, react.createElement)("button", {
9528
- key: account.id,
9836
+ }), sessionAccount === void 0 ? null : (0, react.createElement)("div", {
9837
+ "data-copilot-account-options": "",
9838
+ style: {
9839
+ display: "grid",
9840
+ gap: 4,
9841
+ maxHeight: 220,
9842
+ overflowY: "auto",
9843
+ overscrollBehavior: "contain"
9844
+ }
9845
+ }, ...accountOptions.map((option) => (0, react.createElement)("button", {
9846
+ key: option.id ?? "follow-global",
9529
9847
  type: "button",
9848
+ disabled: savingAccount,
9530
9849
  style: {
9531
9850
  ...button,
9532
- textAlign: "left"
9851
+ textAlign: "left",
9852
+ border: "none",
9853
+ whiteSpace: "normal",
9854
+ overflowWrap: "anywhere",
9855
+ background: option.selected ? "var(--dsw-alias-bg-layer-2, ButtonFace)" : "transparent"
9533
9856
  },
9534
- disabled: savingAccount,
9535
- "aria-pressed": sessionAccount.source === "session" && sessionAccount.accountId === account.id,
9857
+ "aria-pressed": option.selected,
9536
9858
  onClick: () => {
9537
- chooseAccount(account.id);
9859
+ chooseAccount(option.id);
9538
9860
  }
9539
- }, account.identity ? `@${account.identity.login}` : account.id === "canonical" ? `${t.originalAuthorization} · ${t.identityUnknown}` : `${t.savedAuthorization}${numberedUnknownAccounts.has(account.id) ? ` ${numberedUnknownAccounts.get(account.id)}` : ""} · ${t.identityUnknown}`))) : null, sessionAccount?.accounts.diagnostic === void 0 ? null : (0, react.createElement)("code", { style: muted }, sessionAccount.accounts.diagnostic), accountFailed || accountSaveFailed ? (0, react.createElement)("p", {
9861
+ }, option.label))), sessionAccount !== void 0 && accountOptions.length === 0 ? (0, react.createElement)("p", {
9862
+ role: "status",
9863
+ style: muted
9864
+ }, t.noAccounts) : null, savingAccount ? (0, react.createElement)("p", {
9865
+ role: "status",
9866
+ style: muted
9867
+ }, confirmingAccount ? t.confirmingAccount : t.savingAccount) : null, props.accountActions === void 0 ? null : (0, react.createElement)("div", { style: separator }, props.accountActions)) : null, sessionAccount?.accounts.diagnostic === void 0 ? null : (0, react.createElement)("code", { style: muted }, sessionAccount.accounts.diagnostic), accountFailed || accountSaveFailed ? (0, react.createElement)("p", {
9540
9868
  role: "alert",
9541
9869
  style: muted
9542
- }, accountSaveFailed ? t.accountSaveFailed : t.accountMissing) : null), view?.state === "stale" ? (0, react.createElement)("p", {
9870
+ }, accountSaveFailed ? t.accountSaveFailed : t.accountMissing) : null), props.continuation, view?.state === "stale" ? (0, react.createElement)("p", {
9543
9871
  role: "status",
9544
9872
  style: muted
9545
9873
  }, t.stale) : null, view?.diagnostic === void 0 ? null : (0, react.createElement)("code", { style: muted }, view.diagnostic), props.remote === void 0 ? (0, react.createElement)("p", {
@@ -9605,7 +9933,379 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9605
9933
  }, t.plan), (0, react.createElement)("details", { style: muted }, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, t.manual), (0, react.createElement)("code", { style: {
9606
9934
  userSelect: "all",
9607
9935
  overflowWrap: "anywhere"
9608
- } }, "https://github.com/settings/copilot"))) : null);
9936
+ } }, "https://github.com/settings/copilot")), (0, react.createElement)("div", { style: {
9937
+ ...separator,
9938
+ display: "grid",
9939
+ gap: 6
9940
+ } }, (0, react.createElement)("button", {
9941
+ type: "button",
9942
+ role: "link",
9943
+ disabled: props.onManage === void 0,
9944
+ "aria-describedby": props.onManage === void 0 ? `${id}-navigation` : void 0,
9945
+ style: {
9946
+ ...button,
9947
+ border: "none",
9948
+ background: "transparent",
9949
+ textAlign: "left",
9950
+ textDecoration: "underline",
9951
+ padding: 0,
9952
+ color: props.onManage === void 0 ? secondary : "inherit",
9953
+ cursor: props.onManage === void 0 ? "default" : "pointer"
9954
+ },
9955
+ onClick: () => {
9956
+ if (props.onManage !== void 0) {
9957
+ close();
9958
+ props.onManage();
9959
+ }
9960
+ }
9961
+ }, t.manage), props.onManage === void 0 ? (0, react.createElement)("p", {
9962
+ id: `${id}-navigation`,
9963
+ style: muted
9964
+ }, (0, react.createElement)("code", null, navigationDiagnostic), ` · ${t.navigationUnavailable}`) : null)) : null);
9965
+ }
9966
+ //#endregion
9967
+ //#region lib/types/session-continuation-ui.js
9968
+ const control = {
9969
+ font: "inherit",
9970
+ color: "var(--dsw-alias-label-primary, CanvasText)",
9971
+ background: "var(--dsw-alias-bg-layer-1, Canvas)",
9972
+ colorScheme: "inherit",
9973
+ border: "1px solid var(--dsw-alias-border-main, GrayText)",
9974
+ borderRadius: 6,
9975
+ padding: "6px 10px"
9976
+ };
9977
+ const paragraph = {
9978
+ color: "var(--dsw-alias-label-secondary, GrayText)",
9979
+ fontSize: 13,
9980
+ lineHeight: 1.5
9981
+ };
9982
+ function SessionContinuationCard({ sessionId, remote, locale = "en", running = false, onEnabledChange, expanded = false }) {
9983
+ const zh = locale.startsWith("zh");
9984
+ const [view, setView] = (0, react.useState)();
9985
+ const [busy, setBusy] = (0, react.useState)(false);
9986
+ const [error, setError] = (0, react.useState)(false);
9987
+ const [reload, setReload] = (0, react.useState)(0);
9988
+ const owner = (0, react.useRef)(0);
9989
+ (0, react.useEffect)(() => {
9990
+ onEnabledChange?.(view?.enabled === true || view?.activeTurnEnabled === true);
9991
+ }, [view, onEnabledChange]);
9992
+ (0, react.useEffect)(() => {
9993
+ const generation = ++owner.current;
9994
+ setView(void 0);
9995
+ setBusy(true);
9996
+ setError(false);
9997
+ (async () => {
9998
+ try {
9999
+ const result = await remote?.get(sessionId);
10000
+ const parsed = result?.ok ? SessionContinuationViewSchema.safeParse(result.value) : void 0;
10001
+ if (owner.current !== generation) return;
10002
+ if (!parsed?.success) setError(true);
10003
+ else setView(parsed.data);
10004
+ } catch {
10005
+ if (owner.current === generation) setError(true);
10006
+ } finally {
10007
+ if (owner.current === generation) setBusy(false);
10008
+ }
10009
+ })();
10010
+ return () => {
10011
+ owner.current++;
10012
+ };
10013
+ }, [
10014
+ remote,
10015
+ sessionId,
10016
+ running,
10017
+ reload
10018
+ ]);
10019
+ const save = async (enabled, next = false) => {
10020
+ if (!view || !remote || busy) return;
10021
+ const generation = owner.current;
10022
+ setBusy(true);
10023
+ setError(false);
10024
+ try {
10025
+ const result = next ? await remote.authorizeNext?.(sessionId, view.revision, enabled === true) : await remote.set(sessionId, view.revision, enabled);
10026
+ const parsed = result?.ok ? SessionContinuationViewSchema.safeParse(result.value) : void 0;
10027
+ if (owner.current !== generation) return;
10028
+ if (!parsed?.success) {
10029
+ setView(void 0);
10030
+ setError(true);
10031
+ } else setView(parsed.data);
10032
+ } catch {
10033
+ if (owner.current === generation) {
10034
+ setView(void 0);
10035
+ setError(true);
10036
+ }
10037
+ } finally {
10038
+ if (owner.current === generation) setBusy(false);
10039
+ }
10040
+ };
10041
+ return (0, react.createElement)("details", {
10042
+ open: expanded || void 0,
10043
+ "data-copilot-continuation-settings": "",
10044
+ style: { fontSize: 13 }
10045
+ }, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, zh ? "降级续聊" : "Visible-history continuation", " · ", !view ? zh ? "状态待确认" : "Unknown" : view.enabled ? zh ? "开启" : "On" : view.nextTurnAuthorized ? zh ? "仅下一轮" : "Next turn only" : zh ? "关闭" : "Off"), (0, react.createElement)("p", { style: paragraph }, zh ? "每个新轮次不回放旧加密推理及内嵌摘要,同账号也适用。可见消息、工具记录和磁盘历史不变;可能失去隐含细节。不会自动发送或重试。" : "Every new turn omits old encrypted reasoning and embedded summaries, including on the same account. Visible messages, tool records and disk history stay unchanged; implicit details may be lost. No automatic sending or retries."), (0, react.createElement)("label", { style: {
10046
+ display: "flex",
10047
+ gap: 8,
10048
+ alignItems: "center",
10049
+ flexWrap: "wrap"
10050
+ } }, zh ? "本 Session 默认策略" : "Session policy", (0, react.createElement)("select", {
10051
+ style: control,
10052
+ disabled: busy || !view,
10053
+ value: view?.source === "default" ? "default" : view?.enabled ? "on" : "off",
10054
+ onChange: (event) => void save(event.currentTarget.value === "default" ? null : event.currentTarget.value === "on")
10055
+ }, [
10056
+ ["default", zh ? "沿用创建时默认" : "Use creation-time default"],
10057
+ ["on", zh ? "开启" : "On"],
10058
+ ["off", zh ? "关闭" : "Off"]
10059
+ ].map(([value, label]) => (0, react.createElement)("option", {
10060
+ key: value,
10061
+ value,
10062
+ style: {
10063
+ background: "Canvas",
10064
+ color: "CanvasText"
10065
+ }
10066
+ }, label)))), view?.activeTurnEnabled !== void 0 && view.activeTurnEnabled !== view.enabled ? (0, react.createElement)("p", {
10067
+ role: "status",
10068
+ style: paragraph
10069
+ }, zh ? "当前轮保持原策略,变更从下一轮生效。" : "The active turn keeps its policy; changes apply next turn.") : null, view && !view.enabled ? (0, react.createElement)("div", { style: {
10070
+ display: "flex",
10071
+ flexWrap: "wrap",
10072
+ gap: 8,
10073
+ marginTop: 10
10074
+ } }, (0, react.createElement)("button", {
10075
+ type: "button",
10076
+ style: control,
10077
+ disabled: busy || !remote?.authorizeNext,
10078
+ onClick: () => void save(!view.nextTurnAuthorized, true)
10079
+ }, view.nextTurnAuthorized ? zh ? "撤销下一轮授权" : "Revoke next-turn consent" : zh ? "仅下一轮降级" : "Next turn only"), (0, react.createElement)("button", {
10080
+ type: "button",
10081
+ style: control,
10082
+ disabled: busy,
10083
+ onClick: () => void save(true)
10084
+ }, zh ? "一键持续开启" : "Enable for this Session"), (0, react.createElement)("p", { style: paragraph }, zh ? "点击即同意上述损失。仅下一轮授权在该轮结束或 Host 重启后失效。" : "These actions consent to the loss described above. Next-turn consent expires when that turn ends or the Host restarts.")) : null, error ? (0, react.createElement)("p", {
10085
+ role: "alert",
10086
+ style: paragraph
10087
+ }, "COPILOT_CONTINUATION_STATUS_UNAVAILABLE", (0, react.createElement)("button", {
10088
+ type: "button",
10089
+ style: control,
10090
+ onClick: () => setReload((value) => value + 1)
10091
+ }, zh ? "重试读取" : "Retry read")) : null);
10092
+ }
10093
+ function ContinuationDefaultCard({ remote, locale = "en", onSaved }) {
10094
+ const zh = locale.startsWith("zh");
10095
+ const [view, setView] = (0, react.useState)();
10096
+ const [error, setError] = (0, react.useState)(false);
10097
+ const [busy, setBusy] = (0, react.useState)(false);
10098
+ const [reload, setReload] = (0, react.useState)(0);
10099
+ const lifetime = (0, react.useRef)(0);
10100
+ (0, react.useEffect)(() => {
10101
+ const generation = ++lifetime.current;
10102
+ setBusy(true);
10103
+ setError(false);
10104
+ setView(void 0);
10105
+ (async () => {
10106
+ try {
10107
+ const result = await remote?.defaults?.();
10108
+ const parsed = result?.ok ? ContinuationDefaultViewSchema.safeParse(result.value) : void 0;
10109
+ if (generation !== lifetime.current) return;
10110
+ if (parsed?.success) setView(parsed.data);
10111
+ else setError(true);
10112
+ } catch {
10113
+ if (generation === lifetime.current) setError(true);
10114
+ } finally {
10115
+ if (generation === lifetime.current) setBusy(false);
10116
+ }
10117
+ })();
10118
+ return () => {
10119
+ lifetime.current++;
10120
+ };
10121
+ }, [remote, reload]);
10122
+ const save = async (enabled) => {
10123
+ if (!view || !remote?.setDefault || busy) return;
10124
+ const generation = lifetime.current;
10125
+ setBusy(true);
10126
+ setError(false);
10127
+ try {
10128
+ const result = await remote.setDefault(view.revision, enabled);
10129
+ const parsed = result.ok ? ContinuationDefaultViewSchema.safeParse(result.value) : void 0;
10130
+ if (generation !== lifetime.current) return;
10131
+ if (parsed?.success) {
10132
+ setView(parsed.data);
10133
+ onSaved?.();
10134
+ } else {
10135
+ setView(void 0);
10136
+ setError(true);
10137
+ }
10138
+ } catch {
10139
+ if (generation === lifetime.current) {
10140
+ setView(void 0);
10141
+ setError(true);
10142
+ }
10143
+ } finally {
10144
+ if (generation === lifetime.current) setBusy(false);
10145
+ }
10146
+ };
10147
+ return (0, react.createElement)("details", null, (0, react.createElement)("summary", null, zh ? "新 Session 降级默认" : "New Session continuation default"), (0, react.createElement)("label", null, (0, react.createElement)("input", {
10148
+ type: "checkbox",
10149
+ checked: view?.enabled ?? false,
10150
+ disabled: busy || !view,
10151
+ onChange: (event) => void save(event.currentTarget.checked)
10152
+ }), zh ? "新 Session 默认开启降级续聊" : "Enable visible-history continuation for new Sessions"), (0, react.createElement)("p", { style: paragraph }, zh ? "开启即同意新 Session 每轮省略旧加密推理及内嵌摘要,同账号也适用。已有 Session 和继承历史不自动授权,不修改消息或工具记录。" : "Enabling consents to omitting prior encrypted reasoning and embedded summaries each turn, even on the same account. Existing Sessions and seeded histories are not automatically enrolled. Messages and tools are unchanged."), error ? (0, react.createElement)("p", { role: "alert" }, "COPILOT_CONTINUATION_STATUS_UNAVAILABLE", (0, react.createElement)("button", {
10153
+ type: "button",
10154
+ style: control,
10155
+ onClick: () => setReload((value) => value + 1)
10156
+ }, zh ? "重试" : "Retry")) : null);
10157
+ }
10158
+ function SwitchConfirmation({ consent, sessionId, remote, locale, done, cancel }) {
10159
+ const zh = locale.startsWith("zh");
10160
+ const [busy, setBusy] = (0, react.useState)(false);
10161
+ const [error, setError] = (0, react.useState)(false);
10162
+ const active = (0, react.useRef)(true);
10163
+ (0, react.useEffect)(() => {
10164
+ active.current = true;
10165
+ return () => {
10166
+ active.current = false;
10167
+ consent.resolve(false);
10168
+ cancel();
10169
+ };
10170
+ }, [consent]);
10171
+ const choose = async (choice) => {
10172
+ if (busy) return;
10173
+ if (choice === "off") {
10174
+ done(true);
10175
+ return;
10176
+ }
10177
+ setBusy(true);
10178
+ setError(false);
10179
+ try {
10180
+ const result = choice === "session" ? await remote.set(sessionId, consent.view.revision, true) : await remote.authorizeNext?.(sessionId, consent.view.revision, true);
10181
+ const parsed = result?.ok ? SessionContinuationViewSchema.safeParse(result.value) : void 0;
10182
+ if (!active.current) return;
10183
+ if (!parsed?.success || (choice === "session" ? !parsed.data.enabled : !parsed.data.nextTurnAuthorized)) setError(true);
10184
+ else done(true);
10185
+ } catch {
10186
+ if (active.current) setError(true);
10187
+ } finally {
10188
+ if (active.current) setBusy(false);
10189
+ }
10190
+ };
10191
+ return (0, react.createElement)("section", {
10192
+ role: "group",
10193
+ "aria-label": zh ? "切换账号前确认" : "Before switching accounts",
10194
+ style: {
10195
+ border: control.border,
10196
+ borderRadius: 6,
10197
+ padding: 10,
10198
+ marginBlock: 10
10199
+ }
10200
+ }, (0, react.createElement)("strong", null, zh ? "此 Session 的降级续聊未开启" : "Continuation is off for this Session"), (0, react.createElement)("p", { style: paragraph }, zh ? "切换账号后,旧加密推理可能被拒绝,但不一定失败。降级每轮省略旧推理及内嵌摘要,保留可见消息与工具记录;可能损失隐含细节。仅下一轮授权在该轮结束或 Host 重启后失效。不会自动重试。" : "After switching, old encrypted reasoning may be rejected; failure is not certain. Continuation omits old reasoning and embedded summaries each turn while keeping visible messages and tools. Implicit details may be lost. Next-turn consent expires when that turn ends or the Host restarts. No automatic retry."), (0, react.createElement)("div", { style: {
10201
+ display: "flex",
10202
+ flexWrap: "wrap",
10203
+ gap: 8
10204
+ } }, (0, react.createElement)("button", {
10205
+ type: "button",
10206
+ style: control,
10207
+ disabled: busy,
10208
+ onClick: () => void choose("session")
10209
+ }, zh ? "持续开启并切换" : "Enable for Session and switch"), (0, react.createElement)("button", {
10210
+ type: "button",
10211
+ style: control,
10212
+ disabled: busy || !remote.authorizeNext,
10213
+ onClick: () => void choose("next")
10214
+ }, zh ? "仅下一轮并切换" : "Next turn only and switch"), (0, react.createElement)("button", {
10215
+ type: "button",
10216
+ style: control,
10217
+ disabled: busy,
10218
+ onClick: () => void choose("off")
10219
+ }, zh ? "保持关闭并切换" : "Keep off and switch"), (0, react.createElement)("button", {
10220
+ type: "button",
10221
+ style: control,
10222
+ disabled: busy,
10223
+ onClick: () => done(false)
10224
+ }, zh ? "取消" : "Cancel")), error ? (0, react.createElement)("p", {
10225
+ role: "alert",
10226
+ style: paragraph
10227
+ }, zh ? "授权保存未确认,账号未切换。取消后重新读取状态再试。" : "Authorization was not confirmed; account not switched. Cancel and read current status before trying again.") : null);
10228
+ }
10229
+ function useSessionContinuationSwitch({ sessionId, remote, locale = "en", changesAccount, running = false }) {
10230
+ const [consent, setConsent] = (0, react.useState)();
10231
+ const pending = (0, react.useRef)();
10232
+ const generation = (0, react.useRef)(0);
10233
+ (0, react.useEffect)(() => {
10234
+ setConsent(void 0);
10235
+ return () => {
10236
+ generation.current++;
10237
+ pending.current?.resolve(false);
10238
+ pending.current = void 0;
10239
+ };
10240
+ }, [sessionId, remote]);
10241
+ const beforeAccountChange = (0, react.useCallback)(async (accountId, signal) => {
10242
+ const owner = generation.current;
10243
+ if (signal?.aborted) return false;
10244
+ const changed = await changesAccount(accountId);
10245
+ if (owner !== generation.current || signal?.aborted) return false;
10246
+ if (!changed) return true;
10247
+ const result = await remote?.get(sessionId);
10248
+ if (owner !== generation.current || signal?.aborted) return false;
10249
+ const parsed = result?.ok ? SessionContinuationViewSchema.safeParse(result.value) : void 0;
10250
+ if (!parsed?.success) throw new Error("COPILOT_CONTINUATION_STATUS_UNAVAILABLE");
10251
+ if (parsed.data.enabled || parsed.data.nextTurnAuthorized) return true;
10252
+ pending.current?.resolve(false);
10253
+ return new Promise((resolve) => {
10254
+ let settled = false;
10255
+ const next = {
10256
+ view: parsed.data,
10257
+ resolve: (approved) => {
10258
+ if (settled) return;
10259
+ settled = true;
10260
+ signal?.removeEventListener("abort", abort);
10261
+ resolve(approved);
10262
+ }
10263
+ };
10264
+ const abort = () => {
10265
+ next.resolve(false);
10266
+ if (pending.current === next) {
10267
+ pending.current = void 0;
10268
+ setConsent(void 0);
10269
+ }
10270
+ };
10271
+ pending.current = next;
10272
+ signal?.addEventListener("abort", abort, { once: true });
10273
+ if (signal?.aborted) {
10274
+ abort();
10275
+ return;
10276
+ }
10277
+ setConsent(next);
10278
+ });
10279
+ }, [
10280
+ remote,
10281
+ sessionId,
10282
+ changesAccount
10283
+ ]);
10284
+ const done = (approved) => {
10285
+ const current = pending.current;
10286
+ pending.current = void 0;
10287
+ current?.resolve(approved);
10288
+ setConsent(void 0);
10289
+ };
10290
+ return {
10291
+ beforeAccountChange,
10292
+ content: (0, react.createElement)(react.Fragment, null, consent && remote ? (0, react.createElement)(SwitchConfirmation, {
10293
+ key: consent.view.revision,
10294
+ consent,
10295
+ sessionId,
10296
+ remote,
10297
+ locale,
10298
+ done,
10299
+ cancel: () => {
10300
+ if (pending.current === consent) done(false);
10301
+ }
10302
+ }) : null, (0, react.createElement)(SessionContinuationCard, {
10303
+ sessionId,
10304
+ remote,
10305
+ locale,
10306
+ running
10307
+ }))
10308
+ };
9609
10309
  }
9610
10310
  //#endregion
9611
10311
  //#region lib/types/copilot-usage-ui.js
@@ -9624,6 +10324,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9624
10324
  function isSessionRemote(value) {
9625
10325
  return record$2(value) && typeof value.get === "function" && typeof value.set === "function" && typeof value.refreshIdentity === "function" && typeof value.ensureIdentity === "function" && typeof value.usage === "function" && typeof value.refreshUsage === "function";
9626
10326
  }
10327
+ function isContinuationRemote(value) {
10328
+ return record$2(value) && typeof value.get === "function" && typeof value.set === "function" && (value.authorizeNext === void 0 || typeof value.authorizeNext === "function") && (value.defaults === void 0 || typeof value.defaults === "function") && (value.setDefault === void 0 || typeof value.setDefault === "function");
10329
+ }
9627
10330
  function isLocale$2(value) {
9628
10331
  return record$2(value) && typeof value.getLocale === "function" && typeof value.subscribe === "function";
9629
10332
  }
@@ -9644,11 +10347,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9644
10347
  if (!selection(next)) return void 0;
9645
10348
  return next.provider === "github-copilot" || next.provider === "github-copilot-preview" ? next : void 0;
9646
10349
  }
9647
- function Surface$2({ runtime, remote, accountsRemote, sessionRemote, locale, diagnostic }) {
10350
+ function Surface$2({ runtime, remote, accountsRemote, addRemote, sessionRemote, continuationRemote, locale, diagnostic }) {
9648
10351
  const valid = runtime.useSession((session) => record$2(session) && session.sessionId === runtime.sessionId && session.removed === false && session.openState === "open");
9649
10352
  const projection = runtime.useProjection("modelSelection");
10353
+ const running = runtime.useSession((value) => !record$2(value) || value.running !== false);
9650
10354
  const language = (0, react.useSyncExternalStore)(locale === void 0 ? emptySubscribe : (listener) => locale.subscribe(listener), () => locale?.getLocale().active ?? "en", () => "en");
9651
10355
  const current = effectiveCopilot(projection);
10356
+ const changesAccount = (0, react.useCallback)(async (accountId) => {
10357
+ const result = await sessionRemote?.get(runtime.sessionId);
10358
+ const parsed = result?.ok ? SessionAccountViewSchema.safeParse(result.value) : void 0;
10359
+ if (!parsed?.success) throw new Error("COPILOT_SESSION_ACCOUNTS_REMOTE_UNAVAILABLE");
10360
+ return (accountId ?? parsed.data.globalAccountId) !== parsed.data.accountId;
10361
+ }, [sessionRemote, runtime.sessionId]);
10362
+ const continuation = useSessionContinuationSwitch({
10363
+ sessionId: runtime.sessionId,
10364
+ remote: continuationRemote,
10365
+ locale: language,
10366
+ changesAccount,
10367
+ running
10368
+ });
10369
+ const added = (0, react.useCallback)(() => {
10370
+ accountPresentationChanges.begin()();
10371
+ }, []);
9652
10372
  const bound = (0, react.useMemo)(() => {
9653
10373
  if (sessionRemote === void 0) return void 0;
9654
10374
  const id = runtime.sessionId;
@@ -9701,7 +10421,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9701
10421
  remote: current.provider === "github-copilot-preview" ? bound?.usage : remote,
9702
10422
  accountsRemote: current.provider === "github-copilot-preview" ? bound?.identity : accountsRemote,
9703
10423
  sessionAccount: current.provider === "github-copilot-preview" ? bound?.account : void 0,
9704
- locale: language
10424
+ locale: language,
10425
+ continuation: current.provider === "github-copilot-preview" ? continuation.content : void 0,
10426
+ beforeAccountChange: current.provider === "github-copilot-preview" ? continuation.beforeAccountChange : void 0,
10427
+ accountActions: current.provider === "github-copilot-preview" ? (0, react.createElement)(CopilotAccountAdd, {
10428
+ remote: addRemote,
10429
+ locale: language,
10430
+ onChanged: added
10431
+ }) : void 0,
10432
+ navigationDiagnostic: language.startsWith("zh") ? "当前 Core 未提供公开的 Models 直达导航。请打开设置 → 模型 → GitHub Copilot → 管理;返回后草稿与本 Session 设置不变。" : "This Core has no public Models deep link. Open Settings → Models → GitHub Copilot → Manage; your draft and Session settings remain unchanged."
9705
10433
  });
9706
10434
  }
9707
10435
  /** Public additive dock only; native composer, ContextMeter and other features stay owned by Core. */
@@ -9722,6 +10450,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9722
10450
  let remote;
9723
10451
  let accountsRemote;
9724
10452
  let sessionRemote;
10453
+ let continuationRemote;
10454
+ let addRemote;
9725
10455
  try {
9726
10456
  const namespaces = ctx.remote;
9727
10457
  const face = record$2(namespaces) ? namespaces.githubCopilotUsage : void 0;
@@ -9730,9 +10460,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9730
10460
  const accounts = record$2(namespaces) ? namespaces.githubCopilotAccounts : void 0;
9731
10461
  if (record$2(accounts) && typeof accounts.get === "function" && typeof accounts.refreshIdentity === "function" && typeof accounts.ensureIdentity === "function") accountsRemote = accounts;
9732
10462
  else diagnostic("COPILOT_ACCOUNTS_REMOTE_UNAVAILABLE");
10463
+ if (record$2(accounts) && typeof accounts.get === "function" && typeof accounts.add === "function" && typeof accounts.cancel === "function") addRemote = accounts;
10464
+ else diagnostic("COPILOT_ACCOUNT_ADD_REMOTE_UNAVAILABLE");
9733
10465
  const session = record$2(namespaces) ? namespaces.githubCopilotSessionAccount : void 0;
9734
10466
  if (isSessionRemote(session)) sessionRemote = session;
9735
10467
  else diagnostic("COPILOT_SESSION_ACCOUNTS_REMOTE_UNAVAILABLE");
10468
+ const continuation = record$2(namespaces) ? namespaces.githubCopilotSessionContinuation : void 0;
10469
+ if (isContinuationRemote(continuation)) continuationRemote = continuation;
10470
+ else diagnostic("COPILOT_CONTINUATION_REMOTE_UNAVAILABLE");
9736
10471
  } catch {
9737
10472
  diagnostic("COPILOT_USAGE_REMOTE_UNAVAILABLE");
9738
10473
  }
@@ -9764,7 +10499,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9764
10499
  runtime: props,
9765
10500
  remote,
9766
10501
  accountsRemote,
10502
+ addRemote,
9767
10503
  sessionRemote,
10504
+ continuationRemote,
9768
10505
  locale,
9769
10506
  diagnostic
9770
10507
  });
@@ -9831,7 +10568,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9831
10568
  const composerNoticeStyle = {
9832
10569
  width: "100%",
9833
10570
  minWidth: 0,
9834
- maxWidth: "100%",
10571
+ maxWidth: "var(--dsh-composer-card-max-width, 100%)",
10572
+ marginInline: "auto",
9835
10573
  boxSizing: "border-box",
9836
10574
  fontFamily: "var(--dsw-font-family, inherit)",
9837
10575
  fontSize: "var(--dsh-content-font-size-secondary, 13px)",
@@ -9840,6 +10578,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9840
10578
  color: "var(--dsw-alias-label-secondary, GrayText)",
9841
10579
  overflowWrap: "anywhere"
9842
10580
  };
10581
+ const composerNoticeSurfaceStyle = {
10582
+ ...composerNoticeStyle,
10583
+ padding: "10px 12px",
10584
+ borderRadius: "var(--dsw-radius-md, 8px)",
10585
+ background: "var(--dsw-alias-interactive-bg-hover, transparent)"
10586
+ };
10587
+ const composerNoticeQuietButtonStyle = {
10588
+ fontFamily: "inherit",
10589
+ fontSize: "inherit",
10590
+ fontWeight: "inherit",
10591
+ lineHeight: "inherit",
10592
+ color: "inherit",
10593
+ background: "transparent",
10594
+ border: 0,
10595
+ padding: "6px 10px",
10596
+ cursor: "pointer",
10597
+ maxWidth: "100%"
10598
+ };
9843
10599
  const composerNoticeParagraphStyle = {
9844
10600
  marginBlock: 8,
9845
10601
  maxWidth: "38rem"
@@ -9875,7 +10631,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9875
10631
  }
9876
10632
  const copy = {
9877
10633
  en: {
9878
- title: "Context reading unavailable",
10634
+ title: "Context unknown · native 0% is not an empty-context reading",
9879
10635
  explanation: "A failed Copilot attempt reported zero usage. The native 0% is not evidence of an empty context.",
9880
10636
  sample: "Last valid input sample (including cache)",
9881
10637
  historical: "Historical sample, not current occupancy. No percentage is inferred.",
@@ -9884,7 +10640,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9884
10640
  unknown: "Context sampling evidence is incomplete. No current occupancy can be inferred."
9885
10641
  },
9886
10642
  zh: {
9887
- title: "上下文读数暂不可用",
10643
+ title: "上下文未知 · 原生 0% 不代表上下文为空",
9888
10644
  explanation: "失败的 Copilot 请求记录了零用量。原生 0% 不代表上下文为空。",
9889
10645
  sample: "最后有效输入采样(含缓存)",
9890
10646
  historical: "这是历史采样,不是当前占用;不会据此推算百分比。",
@@ -9975,7 +10731,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
9975
10731
  function record(value) {
9976
10732
  return value !== null && typeof value === "object" && !Array.isArray(value);
9977
10733
  }
9978
- function ReplayRecoveryCard({ sessionId, remote, locale = "en", running = false, refreshKey = "" }) {
10734
+ function ReplayRecoveryCard({ sessionId, remote, continuation, locale = "en", running = false, refreshKey = "" }) {
9979
10735
  const zh = locale.startsWith("zh");
9980
10736
  const durationName = (0, react.useId)();
9981
10737
  const [view, setView] = (0, react.useState)();
@@ -10060,7 +10816,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10060
10816
  ...button,
10061
10817
  ...composerNoticeStyle,
10062
10818
  width: "auto",
10063
- alignSelf: "flex-start",
10819
+ alignSelf: "center",
10064
10820
  color: button.color
10065
10821
  },
10066
10822
  disabled,
@@ -10070,10 +10826,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10070
10826
  "aria-label": zh ? "回放恢复" : "Replay recovery",
10071
10827
  "data-copilot-composer-notice": "replay",
10072
10828
  "aria-busy": busy,
10073
- style: {
10074
- ...composerNoticeStyle,
10075
- paddingBlock: 8
10076
- }
10829
+ style: composerNoticeSurfaceStyle
10077
10830
  }, (0, react.createElement)("strong", {
10078
10831
  role: "status",
10079
10832
  style: {
@@ -10083,7 +10836,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10083
10836
  }, evidence?.state === "enabled" ? zh ? "回放恢复已授权" : "Replay recovery authorized" : evidence ? zh ? "旧推理回放被拒绝" : "Old reasoning replay was rejected" : zh ? "回放恢复" : "Replay recovery"), error ? (0, react.createElement)("p", {
10084
10837
  role: "alert",
10085
10838
  style: composerNoticeParagraphStyle
10086
- }, 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", { style: composerNoticeParagraphStyle }, zh ? "授权或失败证据已失效。恢复未启用;没有当前可用的失败证据。" : "Authorization or failure evidence expired. Recovery is off; no current failure evidence is available.") : null, evidence ? (0, react.createElement)("div", null, (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? `${evidence.model}:${evidence.itemCount} 条已识别的旧加密推理项。` : `${evidence.model}: ${evidence.itemCount} identified old encrypted reasoning items.`), evidence.state === "enabled" ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, evidence.duration === "next-turn" ? zh ? "仅下一轮使用恢复,覆盖该轮的全部步骤与原生重试,轮结束即关闭。" : "Authorized for the next matching turn only, including all its steps and native retries; turns off when that turn ends." : zh ? "本会话继续使用恢复,直到关闭或验证状态失效。" : "Authorized for this session until disabled or validation expires.", " ", zh ? "尚未发送消息。请使用原生发送或重试按钮继续。" : "No message has been sent. Use the native Send or Retry control to continue.") : (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? "恢复未启用。确认损失后才能跳过这些旧项;不会自动重试。" : "Recovery is off. Review the loss before skipping these old items; nothing is retried automatically."), confirm ? (0, react.createElement)("div", null, (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? "恢复会跳过已识别的旧项,包括对应隐藏推理状态及项内摘要。磁盘历史、界面可见消息及工具调用保持不变;新推理照常保留。关闭不能撤销已生成的回答。" : "Recovery skips the identified old items, including their hidden reasoning state and item summaries. Stored history, displayed messages and tool calls stay unchanged; new reasoning is retained. Disabling cannot undo generated answers."), (0, react.createElement)("fieldset", {
10839
+ }, 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", { style: composerNoticeParagraphStyle }, zh ? "授权或失败证据已失效。恢复未启用;没有当前可用的失败证据。" : "Authorization or failure evidence expired. Recovery is off; no current failure evidence is available.") : null, evidence ? (0, react.createElement)("div", null, continuation && evidence.state === "available" ? (0, react.createElement)("div", null, (0, react.createElement)(SessionContinuationCard, {
10840
+ sessionId,
10841
+ remote: continuation,
10842
+ locale,
10843
+ running,
10844
+ expanded: true
10845
+ }), (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? "授权后请使用原生重试按钮继续。完整账号管理:设置 → 模型 → GitHub Copilot → 管理。" : "After authorization, use the native Retry control. Full account management: Settings → Models → GitHub Copilot → Manage.")) : null, evidence.state === "enabled" ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, evidence.duration === "next-turn" ? zh ? "仅下一轮使用恢复,覆盖该轮的全部步骤与原生重试,轮结束即关闭。" : "Authorized for the next matching turn only, including all its steps and native retries; turns off when that turn ends." : zh ? "本会话继续使用恢复,直到关闭或验证状态失效。" : "Authorized for this session until disabled or validation expires.", " ", zh ? "尚未发送消息。请使用原生发送或重试按钮继续。" : "No message has been sent. Use the native Send or Retry control to continue.") : (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? "旧推理状态无法在当前账号或连接下继续使用。可查看有损恢复选项,或新建会话;不会自动重试。" : "Old reasoning cannot be reused with this account or connection. Review recovery options or start a new conversation; nothing is retried automatically."), confirm ? (0, react.createElement)("div", null, (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? "恢复会跳过已识别的旧项,包括对应隐藏推理状态及项内摘要。磁盘历史、界面可见消息及工具调用保持不变;新推理照常保留。关闭不能撤销已生成的回答。" : "Recovery skips the identified old items, including their hidden reasoning state and item summaries. Stored history, displayed messages and tool calls stay unchanged; new reasoning is retained. Disabling cannot undo generated answers."), (0, react.createElement)("fieldset", {
10087
10846
  disabled,
10088
10847
  style: {
10089
10848
  border: 0,
@@ -10113,7 +10872,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10113
10872
  onClick: () => void perform(duration)
10114
10873
  }, zh ? "接受损失并授权" : "Accept loss and authorize"), (0, react.createElement)("button", {
10115
10874
  type: "button",
10116
- style: button,
10875
+ style: composerNoticeQuietButtonStyle,
10117
10876
  disabled,
10118
10877
  onClick: () => setConfirm(false)
10119
10878
  }, zh ? "取消" : "Cancel"))) : (0, react.createElement)("div", { style: {
@@ -10127,13 +10886,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10127
10886
  onClick: () => evidence.state === "enabled" ? void perform(false) : (setDuration("next-turn"), setConfirm(true))
10128
10887
  }, evidence.state === "enabled" ? zh ? "关闭恢复" : "Disable recovery" : zh ? "查看恢复选项" : "Review recovery options"), evidence.state === "available" ? (0, react.createElement)("button", {
10129
10888
  type: "button",
10130
- style: button,
10889
+ style: composerNoticeQuietButtonStyle,
10131
10890
  disabled,
10132
10891
  onClick: () => setDismissed(evidence.revision)
10133
10892
  }, zh ? "暂不处理" : "Not now") : null)) : null, running ? (0, react.createElement)("p", {
10134
10893
  role: "status",
10135
10894
  style: composerNoticeParagraphStyle
10136
- }, zh ? "当前轮进行中,结束后自动更新。" : "Turn in progress; status updates when it ends.") : null, (0, react.createElement)("button", {
10895
+ }, zh ? "当前轮进行中,结束后自动更新。" : "Turn in progress; status updates when it ends.") : null, (0, react.createElement)("details", { style: { marginTop: 8 } }, (0, react.createElement)("summary", { style: { cursor: "pointer" } }, zh ? "技术详情与状态" : "Technical details and status"), evidence ? (0, react.createElement)("p", { style: composerNoticeParagraphStyle }, zh ? `${evidence.model}:${evidence.itemCount} 条已识别的旧加密推理项;不是已证明无效的项数。` : `${evidence.model}: ${evidence.itemCount} identified old encrypted reasoning items; not a count of proven invalid items.`) : null, (0, react.createElement)("button", {
10137
10896
  type: "button",
10138
10897
  style: {
10139
10898
  ...button,
@@ -10141,7 +10900,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10141
10900
  },
10142
10901
  disabled,
10143
10902
  onClick: () => void perform()
10144
- }, busy ? zh ? "正在读取…" : "Reading…" : zh ? "重新读取状态" : "Read status again"));
10903
+ }, busy ? zh ? "正在读取…" : "Reading…" : zh ? "重新读取状态" : "Read status again")));
10145
10904
  }
10146
10905
  function isSlots(value) {
10147
10906
  return record(value) && typeof value.spec === "function" && typeof value.inject === "function" && typeof value.register === "function";
@@ -10152,7 +10911,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10152
10911
  function isRuntime(value) {
10153
10912
  return record(value) && typeof value.sessionId === "string" && value.sessionId !== "" && typeof value.useSession === "function" && typeof value.useProjection === "function";
10154
10913
  }
10155
- function Surface({ runtime, remote, locale }) {
10914
+ function Surface({ runtime, remote, continuation, locale }) {
10156
10915
  const valid = runtime.useSession((value) => record(value) && value.sessionId === runtime.sessionId && value.removed === false && value.openState === "open");
10157
10916
  const selected = runtime.useProjection("modelSelection");
10158
10917
  const running = runtime.useSession((value) => !record(value) || value.running !== false);
@@ -10163,6 +10922,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10163
10922
  key: JSON.stringify([runtime.sessionId, selected.next.model]),
10164
10923
  sessionId: runtime.sessionId,
10165
10924
  remote,
10925
+ continuation,
10166
10926
  locale: language,
10167
10927
  running,
10168
10928
  refreshKey: lastError
@@ -10175,7 +10935,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10175
10935
  return noop;
10176
10936
  }
10177
10937
  const slots = candidate;
10178
- const remote = ctx.remote.githubCopilotReplayRecovery;
10938
+ let faces;
10179
10939
  const language = ctx.get("locale");
10180
10940
  const locale = isLocale(language) ? language : void 0;
10181
10941
  const name = "conversation.input.dock";
@@ -10185,6 +10945,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10185
10945
  ctx.logger.warn("COPILOT_REPLAY_RECOVERY_SLOT_UNAVAILABLE");
10186
10946
  return noop;
10187
10947
  }
10948
+ faces ??= {
10949
+ remote: ctx.remote.githubCopilotReplayRecovery,
10950
+ continuation: ctx.remote.githubCopilotSessionContinuation
10951
+ };
10952
+ const { remote, continuation } = faces;
10188
10953
  return slots.register({
10189
10954
  name,
10190
10955
  id: "github-copilot-replay-recovery",
@@ -10197,6 +10962,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10197
10962
  return (0, react.createElement)(Surface, {
10198
10963
  runtime: props,
10199
10964
  remote,
10965
+ continuation,
10200
10966
  locale
10201
10967
  });
10202
10968
  });
@@ -10209,7 +10975,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10209
10975
  background: "transparent",
10210
10976
  font: "inherit",
10211
10977
  fontSize: "14px",
10212
- border: "1px solid color-mix(in srgb, currentColor 30%, transparent)",
10978
+ border: "1px solid var(--dsw-alias-border-main, ButtonBorder)",
10979
+ colorScheme: "inherit",
10213
10980
  borderRadius: "8px",
10214
10981
  padding: "7px 12px",
10215
10982
  minHeight: "36px"
@@ -10256,6 +11023,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10256
11023
  props.remote
10257
11024
  ]);
10258
11025
  const available = models?.models ?? [];
11026
+ const availabilityKnown = models?.state === "ready";
10259
11027
  const settingsKnown = preferences !== void 0 && preferences.revision !== void 0;
10260
11028
  const excluded = new Set(preferences?.excludedModelIds ?? []);
10261
11029
  const diagnostic = error ?? preferences?.error ?? (preferences === void 0 ? "COPILOT_MODEL_PREFERENCES_UNAVAILABLE" : void 0);
@@ -10264,14 +11032,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10264
11032
  id: model.id,
10265
11033
  name: model.name,
10266
11034
  available: true
10267
- })), ...(preferences?.unavailableExcludedModelIds ?? []).filter((id) => !available.some((model) => model.id === id)).map((id) => ({
11035
+ })), ...Array.from(/* @__PURE__ */ new Set([...preferences?.excludedModelIds ?? [], ...preferences?.unavailableExcludedModelIds ?? []])).filter((id) => !available.some((model) => model.id === id)).map((id) => ({
10268
11036
  id,
10269
11037
  name: id,
10270
11038
  available: false
10271
11039
  }))];
10272
11040
  const needle = query.trim().toLocaleLowerCase();
10273
- const filtered = rows.filter((model) => (filter === "all" || settingsKnown && (filter === "excluded" ? excluded.has(model.id) : !excluded.has(model.id))) && (needle.length === 0 || model.id.toLocaleLowerCase().includes(needle) || model.name.toLocaleLowerCase().includes(needle)));
11041
+ const filtered = rows.filter((model) => (filter === "all" || filter === "enabled" && settingsKnown && !excluded.has(model.id) || filter === "excluded" && settingsKnown && excluded.has(model.id) || filter === "available" && availabilityKnown && model.available || filter === "unavailable" && availabilityKnown && !model.available) && (needle.length === 0 || model.id.toLocaleLowerCase().includes(needle) || model.name.toLocaleLowerCase().includes(needle)));
10274
11042
  const visibleCount = available.filter((model) => !excluded.has(model.id)).length;
11043
+ const unavailableCount = rows.filter((model) => !model.available).length;
10275
11044
  const update = async (modelId, restore = false) => {
10276
11045
  const scope = request.current;
10277
11046
  if (scope.pending || modelId !== void 0 && !writable) return;
@@ -10330,7 +11099,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10330
11099
  return (0, react.createElement)("details", { "data-dsh-github-copilot-model-preferences": true }, (0, react.createElement)("summary", null, settingsKnown ? `Model preferences · ${visibleCount} enabled · ${excluded.size} excluded` : "Model preferences · Read-only"), (0, react.createElement)("p", { style: {
10331
11100
  fontSize: "14px",
10332
11101
  marginBlock: "12px"
10333
- } }, "Excluded models disappear from the managed picker and cannot start a new turn, including Auto. An admitted turn keeps its model. Fixed selections are not changed; select another model before the next turn. Restoring a model does not select it."), diagnostic === void 0 ? null : (0, react.createElement)("div", {
11102
+ } }, "Exclusions are shared across GitHub Copilot accounts; availability below reflects the current account. Newly discovered models are enabled by default. Unavailable saved exclusions are retained and apply again if that model returns. Excluded models disappear from the managed picker and cannot start a new turn, including Auto. An admitted turn keeps its model. Fixed selections are not changed; select another model before the next turn. Restoring a model does not select it."), availabilityKnown ? null : (0, react.createElement)("p", { role: "status" }, "Current account availability unconfirmed. Shown models reflect the last metadata snapshot and saved exclusions, not a current availability check."), diagnostic === void 0 ? null : (0, react.createElement)("div", {
10334
11103
  role: "alert",
10335
11104
  "data-dsh-github-copilot-model-preferences-error": true,
10336
11105
  style: {
@@ -10355,7 +11124,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10355
11124
  fontSize: "16px",
10356
11125
  width: "100%",
10357
11126
  boxSizing: "border-box",
10358
- minWidth: 0
11127
+ minWidth: 0,
11128
+ background: "var(--dsw-alias-bg-layer-1, Canvas)",
11129
+ color: "var(--dsw-alias-label-primary, CanvasText)"
10359
11130
  },
10360
11131
  onChange: (event) => setQuery(event.currentTarget.value),
10361
11132
  placeholder: "Search by name or exact model ID",
@@ -10372,19 +11143,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10372
11143
  }, [
10373
11144
  "all",
10374
11145
  "enabled",
10375
- "excluded"
11146
+ "excluded",
11147
+ "available",
11148
+ "unavailable"
10376
11149
  ].map((value) => (0, react.createElement)("button", {
10377
11150
  key: value,
10378
11151
  type: "button",
10379
11152
  "aria-pressed": filter === value,
10380
- disabled: value !== "all" && !settingsKnown,
11153
+ disabled: (value === "enabled" || value === "excluded") && !settingsKnown || (value === "available" || value === "unavailable") && !availabilityKnown,
10381
11154
  onClick: () => setFilter(value),
10382
11155
  style: {
10383
11156
  ...controlStyle,
10384
11157
  fontWeight: filter === value ? 600 : 400,
10385
11158
  background: filter === value ? "color-mix(in srgb, currentColor 12%, transparent)" : "transparent"
10386
11159
  }
10387
- }, value === "all" ? `All (${rows.length})` : value === "enabled" ? `Enabled (${settingsKnown ? visibleCount : "?"})` : `Excluded (${settingsKnown ? excluded.size : "?"})`))), filtered.length === 0 ? (0, react.createElement)("p", { role: "status" }, rows.length === 0 ? "No account models to display. Use Refresh models to read account metadata." : "No models match this filter or search.") : (0, react.createElement)("ul", {
11160
+ }, value === "all" ? `All (${rows.length})` : value === "enabled" ? `Enabled (${settingsKnown ? visibleCount : "?"})` : value === "excluded" ? `Excluded (${settingsKnown ? excluded.size : "?"})` : value === "available" ? `Available (${availabilityKnown ? available.length : "?"})` : `Unavailable (${availabilityKnown ? unavailableCount : "?"})`))), filtered.length === 0 ? (0, react.createElement)("p", { role: "status" }, rows.length === 0 ? "No account models to display. Use Refresh models to read account metadata." : "No models match this filter or search.") : (0, react.createElement)("ul", {
10388
11161
  "aria-label": "Account models",
10389
11162
  style: {
10390
11163
  listStyle: "none",
@@ -10408,7 +11181,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10408
11181
  minWidth: 0,
10409
11182
  overflowWrap: "anywhere",
10410
11183
  fontSize: "14px"
10411
- } }, (0, react.createElement)("strong", null, model.name), (0, react.createElement)("br"), (0, react.createElement)("code", null, model.id), (0, react.createElement)("span", null, !settingsKnown ? " · Exclusion status unknown" : isExcluded ? " · Excluded" : " · Enabled"), model.available ? null : (0, react.createElement)("span", null, " · Temporarily absent from account metadata"), errorModel === model.id && error !== void 0 ? (0, react.createElement)("span", {
11184
+ } }, (0, react.createElement)("strong", null, model.name), (0, react.createElement)("br"), (0, react.createElement)("code", null, model.id), (0, react.createElement)("span", null, ` · ${!availabilityKnown ? "Current account availability unconfirmed" : model.available ? "Available on current account" : "Currently unavailable on current account; saved exclusion retained"}`), (0, react.createElement)("span", null, ` · ${!settingsKnown ? "Exclusion status unknown" : isExcluded ? "Excluded" : "Enabled"}`), errorModel === model.id && error !== void 0 ? (0, react.createElement)("span", {
10412
11185
  role: "status",
10413
11186
  style: {
10414
11187
  display: "block",
@@ -10419,7 +11192,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
10419
11192
  style: {
10420
11193
  ...controlStyle,
10421
11194
  flexShrink: 0,
10422
- cursor: disabled ? "not-allowed" : "pointer"
11195
+ cursor: disabled ? "not-allowed" : "pointer",
11196
+ color: disabled ? "var(--dsw-alias-label-secondary, GrayText)" : "inherit"
10423
11197
  },
10424
11198
  disabled,
10425
11199
  "aria-label": `${isExcluded ? "Restore" : "Exclude"} ${model.name}`,
@@ -11000,8 +11774,35 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11000
11774
  maxWidth: "100%",
11001
11775
  cursor: "pointer"
11002
11776
  };
11777
+ const modelsControlCss = `
11778
+ [data-dsh-github-copilot-compact-account] :is(input, select, button) {
11779
+ color-scheme: inherit;
11780
+ }
11781
+ [data-dsh-github-copilot-compact-account] :is(input, select) {
11782
+ background: var(--dsw-alias-bg-layer-1, Canvas);
11783
+ color: var(--dsw-alias-label-primary, CanvasText);
11784
+ }
11785
+ [data-dsh-github-copilot-compact-account] option {
11786
+ background: Canvas;
11787
+ color: CanvasText;
11788
+ }
11789
+ [data-dsh-github-copilot-compact-account] :is(input, select, button, summary, a):focus-visible {
11790
+ outline: 2px solid Highlight;
11791
+ outline-offset: 2px;
11792
+ }
11793
+ [data-dsh-github-copilot-compact-account] :is(input, select, button):disabled {
11794
+ color: var(--dsw-alias-label-secondary, GrayText);
11795
+ cursor: not-allowed;
11796
+ }
11797
+ [data-dsh-github-copilot-compact-account] option:disabled {
11798
+ color: GrayText;
11799
+ }
11800
+ [data-dsh-github-copilot-compact-account] [role="alert"] {
11801
+ color: var(--dsw-alias-label-primary, CanvasText);
11802
+ }
11803
+ `;
11003
11804
  function compactErrorMessage(code, milestone) {
11004
- if (code === "COPILOT_MODEL_DISCOVERY_FAILED") return "Could not refresh models. Try again.";
11805
+ if (code === "COPILOT_MODEL_DISCOVERY_FAILED") return "Could not refresh models. Open Manage and choose Retry in Model preferences.";
11005
11806
  if (code === "COPILOT_AUTHORIZATION_BEGIN_FAILED") return `GitHub sign-in did not complete.${milestone === void 0 ? "" : ` Latest observed milestone: ${milestone}.`} Try again. If it continues, share diagnostic code COPILOT_AUTHORIZATION_BEGIN_FAILED with support.`;
11006
11807
  if (code === "COPILOT_ROUTE_REPAIR_FAILED") return "GitHub sign-in completed, but model configuration repair failed. Authentication is retained. Open Manage and choose Repair model configuration. If it continues, share diagnostic code COPILOT_ROUTE_REPAIR_FAILED with support.";
11007
11808
  if (code === "COPILOT_AUTHORIZATION_START_FAILED") return "Could not confirm sign-in. Retry status to check.";
@@ -11017,6 +11818,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11017
11818
  const state = (0, react.useSyncExternalStore)(account.subscribe, account.getSnapshot, account.getSnapshot);
11018
11819
  (0, react.useEffect)(() => props.account === void 0 ? account.attach() : void 0, [account, props.account]);
11019
11820
  const [manageOpen, setManageOpen] = (0, react.useState)(false);
11821
+ const [accountRevisionKey, setAccountRevisionKey] = (0, react.useState)(0);
11822
+ const refreshAccountRevision = () => setAccountRevisionKey((value) => value + 1);
11020
11823
  const managementId = `github-copilot-management-${(0, react.useId)()}`;
11021
11824
  const view = state.view;
11022
11825
  const signedIn = view?.configured === true;
@@ -11037,34 +11840,38 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11037
11840
  disabled,
11038
11841
  style: {
11039
11842
  ...compactButtonStyle,
11040
- opacity: disabled ? .5 : 1,
11041
- cursor: disabled ? "default" : "pointer"
11843
+ color: disabled ? "var(--dsw-alias-label-secondary, GrayText)" : "inherit",
11844
+ cursor: disabled ? "not-allowed" : "pointer"
11042
11845
  },
11043
11846
  ...extras
11044
11847
  }, label);
11848
+ const accountSettings = (0, react.createElement)("div", { style: {
11849
+ display: "grid",
11850
+ gap: 8
11851
+ } }, routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null);
11852
+ const continuationSettings = props.continuationSettings ?? (0, react.createElement)(ContinuationDefaultCard, {
11853
+ remote: props.continuationRemote,
11854
+ locale: props.locale,
11855
+ onSaved: refreshAccountRevision
11856
+ });
11045
11857
  return (0, react.createElement)("section", {
11046
11858
  "data-dsh-github-copilot-compact-account": true,
11047
11859
  "data-dsh-github-copilot-embedded": props.embedded === true ? true : void 0,
11048
11860
  "aria-label": props.embedded === true ? "GitHub Copilot account" : void 0,
11049
11861
  style: props.embedded === true ? {
11050
11862
  minWidth: 0,
11051
- marginTop: "8px"
11863
+ marginTop: "8px",
11864
+ colorScheme: "light dark"
11052
11865
  } : {
11053
11866
  minWidth: 0,
11054
11867
  padding: "12px 14px",
11055
11868
  margin: "12px 0",
11056
11869
  borderRadius: "16px",
11057
11870
  border: "1px solid color-mix(in srgb, currentColor 24%, transparent)",
11058
- background: "transparent"
11871
+ background: "transparent",
11872
+ colorScheme: "light dark"
11059
11873
  }
11060
- }, props.accountsRemote === void 0 ? null : (0, react.createElement)(CopilotAccountsPanel, {
11061
- remote: props.accountsRemote,
11062
- expanded: manageOpen,
11063
- onChanged: account.retryStatus,
11064
- authorizationBusy,
11065
- configured: view?.configured,
11066
- locale: props.locale
11067
- }), (0, react.createElement)("div", { style: {
11874
+ }, (0, react.createElement)("style", null, modelsControlCss), (0, react.createElement)("div", { style: {
11068
11875
  display: "flex",
11069
11876
  alignItems: "center",
11070
11877
  flexWrap: "wrap",
@@ -11101,7 +11908,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11101
11908
  gap: "8px",
11102
11909
  marginInlineStart: "auto",
11103
11910
  minWidth: 0
11104
- } }, view === void 0 && !state.checking || state.error === "COPILOT_AUTHORIZATION_STATUS_FAILED" || uncertain ? actionButton("Retry status", account.retryStatus, state.checking || state.operation !== void 0) : null, signedIn && state.error === "COPILOT_MODEL_DISCOVERY_FAILED" ? actionButton("Retry", account.refreshModels, pendingAction, { "data-dsh-github-copilot-retry-models": true }) : null, !signedIn && !authorizing && view !== void 0 ? actionButton("Sign in with GitHub", account.start, pendingAction || view.writable === false, { title: view.writable === false ? "Credentials are read-only" : void 0 }) : null, actionButton("Manage", () => setManageOpen((open) => !open), false, {
11911
+ } }, view === void 0 && !state.checking || state.error === "COPILOT_AUTHORIZATION_STATUS_FAILED" || uncertain ? actionButton("Retry status", account.retryStatus, state.checking || state.operation !== void 0) : null, !signedIn && !authorizing && view !== void 0 ? actionButton("Sign in with GitHub", account.start, pendingAction || view.writable === false, { title: view.writable === false ? "Credentials are read-only" : void 0 }) : null, actionButton("Manage", () => setManageOpen((open) => !open), false, {
11105
11912
  "aria-expanded": manageOpen,
11106
11913
  "aria-controls": managementId
11107
11914
  }))), state.error === void 0 ? null : (0, react.createElement)("p", {
@@ -11128,27 +11935,55 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11128
11935
  copyState: state.copyState,
11129
11936
  onCopy: () => void account.copyCode(),
11130
11937
  buttonStyle: compactButtonStyle
11131
- }), actionButton(state.operation === "cancel" ? "Cancelling…" : "Cancel sign-in", account.cancel, state.operation === "cancel")) : null, manageOpen ? (0, react.createElement)("div", {
11938
+ }), actionButton(state.operation === "cancel" ? "Cancelling…" : "Cancel sign-in", account.cancel, state.operation === "cancel")) : null, (0, react.createElement)("div", {
11132
11939
  id: managementId,
11133
11940
  role: "region",
11134
11941
  "aria-label": "GitHub Copilot account management",
11135
11942
  style: {
11136
11943
  marginTop: "12px",
11137
- paddingTop: "12px",
11138
- borderTop: "1px solid color-mix(in srgb, currentColor 18%, transparent)",
11944
+ paddingTop: manageOpen ? "12px" : 0,
11945
+ borderTop: manageOpen ? "1px solid color-mix(in srgb, currentColor 18%, transparent)" : void 0,
11139
11946
  overflowWrap: "anywhere"
11140
11947
  }
11141
- }, signedIn ? (0, react.createElement)(GitHubCopilotModelPreferencesPanel, {
11948
+ }, props.accountsRemote === void 0 ? null : (0, react.createElement)(CopilotAccountsPanel, {
11949
+ remote: props.accountsRemote,
11950
+ expanded: manageOpen,
11951
+ onChanged: account.retryStatus,
11952
+ refreshKey: accountRevisionKey,
11953
+ authorizationBusy,
11954
+ configured: view?.configured,
11955
+ locale: props.locale,
11956
+ accountSettings,
11957
+ continuationSettings
11958
+ }), manageOpen && props.accountsRemote === void 0 ? (0, react.createElement)("section", { "aria-label": "Account management" }, (0, react.createElement)("h3", { style: {
11959
+ margin: 0,
11960
+ fontSize: 16
11961
+ } }, "Account management"), accountSettings, continuationSettings) : null, manageOpen ? (0, react.createElement)("section", {
11962
+ "data-dsh-github-copilot-model-management": true,
11963
+ "aria-label": "Model preferences",
11964
+ style: {
11965
+ display: "grid",
11966
+ gap: 10,
11967
+ marginTop: 18,
11968
+ paddingTop: 16,
11969
+ borderTop: "1px solid color-mix(in srgb, currentColor 18%, transparent)"
11970
+ }
11971
+ }, (0, react.createElement)("h3", { style: {
11972
+ margin: 0,
11973
+ fontSize: 16
11974
+ } }, "Model preferences"), signedIn ? (0, react.createElement)(GitHubCopilotModelPreferencesPanel, {
11142
11975
  remote: props.remote,
11143
11976
  models,
11144
11977
  preferences: view?.modelPreferences
11145
- }) : null, (0, react.createElement)("details", { style: { marginBlock: "16px" } }, (0, react.createElement)("summary", null, "Discovery details"), (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models })), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, routeStatusMessage(view) === void 0 ? null : (0, react.createElement)("p", { role: "status" }, routeStatusMessage(view)), view?.route?.state === "needs-repair" && signedIn ? actionButton("Repair model configuration", account.reconcile, pendingAction) : null, signedIn ? actionButton(state.operation === "signOut" ? "Signing out…" : "Sign out", account.signOut, pendingAction || view?.writable === false) : null, view?.writable === false ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Credentials are read-only in this profile.") : null) : null);
11978
+ }) : (0, react.createElement)("p", { role: "status" }, "Sign in to manage model preferences."), (0, react.createElement)("details", null, (0, react.createElement)("summary", null, "Discovery details"), (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Signing in here fetches your account models once. Opening this view refreshes missing or stale metadata when needed. No manual model definitions are needed. Refresh models updates account metadata; it does not verify a model call or change your selected model."), models === void 0 ? (0, react.createElement)("p", { style: { fontSize: "13px" } }, "Account model metadata is not available yet.") : (0, react.createElement)(GitHubCopilotAccountModelsSummary, { snapshot: models })), signedIn ? actionButton(refreshing ? "Refreshing models…" : "Refresh models", account.refreshModels, pendingAction, { "data-dsh-github-copilot-refresh-models": true }) : null, signedIn && state.error === "COPILOT_MODEL_DISCOVERY_FAILED" ? actionButton("Retry", account.refreshModels, pendingAction, { "data-dsh-github-copilot-retry-models": true }) : null) : null));
11146
11979
  }
11147
11980
  /** Standalone footer presentation; registered Models seats use the shared surface coordinator. */
11148
11981
  function GitHubCopilotPreviewFooter(props) {
11149
11982
  return (0, react.createElement)("div", { "data-dsh-github-copilot-preview-footer": true }, (0, react.createElement)(GitHubCopilotCompactAccount, {
11150
11983
  remote: props.remote,
11151
11984
  accountsRemote: props.accountsRemote,
11985
+ continuationSettings: props.continuationSettings,
11986
+ continuationRemote: props.continuationRemote,
11152
11987
  locale: props.locale
11153
11988
  }));
11154
11989
  }
@@ -11252,6 +12087,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11252
12087
  return (0, react.createElement)("div", { "data-dsh-github-copilot-account-surface": props.seat.kind }, (0, react.createElement)(GitHubCopilotCompactAccount, {
11253
12088
  remote: props.remote,
11254
12089
  accountsRemote: props.accountsRemote,
12090
+ continuationRemote: props.continuationRemote,
12091
+ continuationSettings: props.continuationSettings,
11255
12092
  account: owner.account,
11256
12093
  embedded,
11257
12094
  locale
@@ -11268,6 +12105,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11268
12105
  const surfaces = createAccountSurfaces();
11269
12106
  const remote = ctx.remote.githubCopilot;
11270
12107
  const accountsRemote = ctx.remote.githubCopilotAccounts;
12108
+ const continuationRemote = ctx.remote.githubCopilotSessionContinuation;
11271
12109
  const localeCandidate = ctx.get("locale");
11272
12110
  const localeReader = isLocaleReader(localeCandidate) ? localeCandidate : void 0;
11273
12111
  const disposeCredentials = ctx.remote.$on("credentials/reference-updated", () => surfaces.invalidate());
@@ -11293,6 +12131,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11293
12131
  seat,
11294
12132
  remote,
11295
12133
  accountsRemote,
12134
+ continuationRemote,
11296
12135
  localeReader
11297
12136
  }));
11298
12137
  disposeFallback = () => {
@@ -11327,6 +12166,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11327
12166
  seat,
11328
12167
  remote,
11329
12168
  accountsRemote,
12169
+ continuationRemote,
11330
12170
  eligible: isGitHubCopilotAccountRow(props),
11331
12171
  localeReader
11332
12172
  });
@@ -11360,6 +12200,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11360
12200
  seat,
11361
12201
  remote,
11362
12202
  accountsRemote,
12203
+ continuationRemote,
11363
12204
  localeReader
11364
12205
  }));
11365
12206
  } catch {
@@ -11519,6 +12360,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11519
12360
  const ui = ctx.inject([
11520
12361
  "remote.githubCopilot",
11521
12362
  "remote.githubCopilotAccounts",
12363
+ "remote.githubCopilotSessionContinuation",
11522
12364
  "slots"
11523
12365
  ], registerUi);
11524
12366
  try {
@@ -11537,10 +12379,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11537
12379
  "remote.githubCopilotUsage",
11538
12380
  "remote.githubCopilotAccounts",
11539
12381
  "remote.githubCopilotSessionAccount",
12382
+ "remote.githubCopilotSessionContinuation",
11540
12383
  "slots"
11541
12384
  ], registerCopilotUsageUi);
11542
12385
  const contextUi = ctx.inject(["slots"], registerContextEvidenceUi);
11543
- const recoveryUi = ctx.inject(["remote.githubCopilotReplayRecovery", "slots"], registerReplayRecoveryUi);
12386
+ const recoveryUi = ctx.inject([
12387
+ "remote.githubCopilotReplayRecovery",
12388
+ "remote.githubCopilotSessionContinuation",
12389
+ "slots"
12390
+ ], registerReplayRecoveryUi);
11544
12391
  const autoUi = ctx.inject([
11545
12392
  "remote.githubCopilotTurnSelection",
11546
12393
  "remote.githubCopilotSessionAccount",