dsh-github-copilot 0.4.0-alpha.51 → 0.4.0-alpha.53

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.
@@ -14,7 +14,7 @@ Normal discovery needs neither manual model definitions nor routine refresh clic
14
14
 
15
15
  The alpha.7 last-success timestamp (`snapshot.discoveredAt`) appears once beside the count outside **Manage**: English relative text with a full local date/time/zone tooltip and accessible semantic `time`. Missing/invalid timestamps or no account hide it; future values use absolute text. Pending/error preserves the last success, a successful refresh supplies a new time and sign-out clears it. The display timer is disposed with the timestamp or unmount; it does not alter cache/discovery behavior.
16
16
 
17
- Last same-account metadata may display during TTL refresh/loading/error, never authorize requests. Credential/account/permission invalidation or proof expiry immediately revokes evidence; TTL does not extend tokens. Definitive `UNKNOWN_MODEL` triggers one bounded metadata refresh, with no message replay or model switching; generic HTTP/network errors are not guessed to mean unknown models. New models still require supported account metadata. The README's primary alpha.7 model-freshness/model-refreshing PNGs show the built Client in isolated Edge with synthetic Remote/provider-shell data, not live Core or production authorization. Host TTL/cooldown timing requires unit tests, not screenshots. The provider-entry/authorization PNGs remain historical alpha.5 and older compact-account GIF/PNGs alpha.3.
17
+ Last same-account metadata may display during TTL refresh/loading/error, never authorize requests. Credential/account/permission invalidation or proof expiry immediately revokes evidence; TTL does not extend tokens. Definitive `UNKNOWN_MODEL` triggers one bounded metadata refresh, with no message replay or model switching; generic HTTP/network errors are not guessed to mean unknown models. New models still require supported account metadata. README screenshots are presentation-only synthetic evidence; Host TTL/cooldown timing requires unit tests, not screenshots.
18
18
 
19
19
  Existing `llm-pi-ai.providers.github-copilot` profiles are not automatically removed. Until you explicitly remove a reviewed legacy profile, both real routes may remain listed. This guide removes that configuration, not merely its display: after removal and catalog refresh, the composer picker and `/model` both list only the managed Copilot group. Discovery failures produce diagnostics; they do not enable a fallback static catalog.
20
20
 
@@ -74,7 +74,7 @@ A previously stuck **Deleting…** dialog is not proof the configuration was or
74
74
 
75
75
  alpha.7 的上次成功时间(`snapshot.discoveredAt`)只在模型数量旁、**Manage** 外显示一次:相对文字为英文,tooltip 和可访问语义 `time` 提供完整本地日期、时间及时区。缺失/无效/无账号时隐藏,未来时间显示绝对值。等待/失败保留上次成功时间,刷新成功才更新,退出登录清除;时间消失或卸载时清理显示定时器。缓存和发现生命周期不变。
76
76
 
77
- 同账号旧元数据可在 TTL 刷新/loading/error 时展示,但不能授权请求。凭据/账号/权限失效或 proof 到期立即撤销证据,TTL 不延长 token。明确 `UNKNOWN_MODEL` 只触发一次有界元数据刷新,不重放消息或切换模型;普通 HTTP/网络错误不能猜成模型不存在。新模型仍需支持的账号元数据。README 首先展示的 alpha.7 model-freshness/model-refreshing PNG 来自实际构建 Client 的隔离 Edge 与合成 Remote/provider-shell 数据,不是真实 Core 或生产授权。Host TTL/冷却时序需单元测试,不能靠截图证明。provider-entry/authorization PNG 仍为 alpha.5 历史示意,旧紧凑账号 GIF/PNG 为 alpha.3。
77
+ 同账号旧元数据可在 TTL 刷新/loading/error 时展示,但不能授权请求。凭据/账号/权限失效或 proof 到期立即撤销证据,TTL 不延长 token。明确 `UNKNOWN_MODEL` 只触发一次有界元数据刷新,不重放消息或切换模型;普通 HTTP/网络错误不能猜成模型不存在。新模型仍需支持的账号元数据。README 截图只提供合成展示证据;Host TTL/冷却时序需单元测试,不能靠截图证明。
78
78
 
79
79
  升级不会自动删除已有 `llm-pi-ai.providers.github-copilot`。只有用户真正移除经过审核的旧配置后,composer 与 `/model` 才都会只列出托管 Copilot 分组,不是仅隐藏第二条路由。始终保留 `llm-pi-ai` 插件、授权服务和唯一 OAuth record `llm-pi-ai/github-copilot`;不要退出登录、删除凭据或卸载授权插件来隐藏分组,也不要用 `models: []` 冒充禁用。
80
80
 
package/lib/client.js CHANGED
@@ -6018,7 +6018,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6018
6018
  ...event.data.preference === void 0 ? {} : { preference: event.data.preference },
6019
6019
  taskClass: event.data.taskClass,
6020
6020
  reason: event.data.reason,
6021
- candidateCount: event.data.candidateCount
6021
+ candidateCount: event.data.candidateCount,
6022
+ ...sequence(event.data.fittingCandidateCount) ? { fittingCandidateCount: event.data.fittingCandidateCount } : {},
6023
+ ...sequence(event.data.estimatedInputTokens) ? { estimatedInputTokens: event.data.estimatedInputTokens } : {},
6024
+ ...sequence(event.data.selectedInputBudget) ? { selectedInputBudget: event.data.selectedInputBudget } : {},
6025
+ ...typeof event.data.inputFitDiagnostic === "string" ? { inputFitDiagnostic: event.data.inputFitDiagnostic } : {}
6022
6026
  }
6023
6027
  };
6024
6028
  }
@@ -6043,7 +6047,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6043
6047
  if (scope !== "turn") return null;
6044
6048
  const state = context.state ?? context.matches.map((match) => attribution(match.event)).find((value) => value !== void 0);
6045
6049
  if (state === void 0) return null;
6046
- if (previous?.turn === state.turn && previous.key === "github-copilot-auto-model-attribution" && previous.value.provider === state.value.provider && previous.value.model === state.value.model && previous.value.reason === state.value.reason && previous.value.taskClass === state.value.taskClass && previous.value.preference === state.value.preference && previous.value.candidateCount === state.value.candidateCount) return previous;
6050
+ if (previous?.turn === state.turn && previous.key === "github-copilot-auto-model-attribution" && previous.value.provider === state.value.provider && previous.value.model === state.value.model && previous.value.reason === state.value.reason && previous.value.taskClass === state.value.taskClass && previous.value.preference === state.value.preference && previous.value.candidateCount === state.value.candidateCount && previous.value.fittingCandidateCount === state.value.fittingCandidateCount && previous.value.inputFitDiagnostic === state.value.inputFitDiagnostic) return previous;
6047
6051
  return {
6048
6052
  kind: "turn",
6049
6053
  turn: state.turn,
@@ -6066,25 +6070,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6066
6070
  return missingSource;
6067
6071
  }
6068
6072
  }
6073
+ /** Inline footer chrome: after the settled clock, hidden until the message is hovered. */
6074
+ const AUTO_ATTRIBUTION_STYLE = [
6075
+ "[data-turn-tail]:has(> [data-copilot-auto-attribution]){flex-direction:row;flex-wrap:wrap;align-items:center;gap:0 8px}",
6076
+ "[data-turn-tail]>[data-copilot-auto-attribution]{order:1;display:inline-flex;align-items:center;gap:6px;margin:0;padding-left:4px;color:var(--dsw-alias-label-tertiary,var(--text-muted,#667085));font-size:14px;line-height:24px;white-space:nowrap}",
6077
+ "@media (hover:hover){[data-time-hover-root]>[data-copilot-auto-attribution]{opacity:0;transition:opacity 80ms ease}",
6078
+ "[data-time-hover-root]:hover>[data-copilot-auto-attribution],[data-time-hover-root]:focus-within>[data-copilot-auto-attribution]{opacity:1}}"
6079
+ ].join("");
6080
+ const AUTO_ATTRIBUTION_STYLE_ID = "dsh-copilot-auto-attribution-style";
6081
+ function ensureAttributionStyle() {
6082
+ if (typeof document === "undefined" || document.getElementById(AUTO_ATTRIBUTION_STYLE_ID)) return;
6083
+ const style = document.createElement("style");
6084
+ style.id = AUTO_ATTRIBUTION_STYLE_ID;
6085
+ style.textContent = AUTO_ATTRIBUTION_STYLE;
6086
+ document.head.appendChild(style);
6087
+ }
6069
6088
  function reasonText(value) {
6070
- return `${value.reason === "short-text-turn" ? "Short text turn" : value.reason === "large-structured-turn" ? "Large structured turn" : value.reason === "image-capability" ? "Image-capable model required" : "Standard turn"}; ${value.preference ?? "balance"} capacity preference; selected from ${value.candidateCount} eligible account model${value.candidateCount === 1 ? "" : "s"}.`;
6089
+ const reason = value.reason === "short-text-turn" ? "Short text turn" : value.reason === "large-structured-turn" ? "Large structured turn" : value.reason === "image-capability" ? "Image-capable model required" : "Standard turn";
6090
+ const fitInfo = value.fittingCandidateCount !== void 0 && value.fittingCandidateCount < value.candidateCount ? `; ${value.fittingCandidateCount} of ${value.candidateCount} models can fit turn context` : "";
6091
+ return `${reason}; ${value.preference ?? "balance"} capacity preference; selected from ${value.candidateCount} eligible account model${value.candidateCount === 1 ? "" : "s"}${fitInfo}.`;
6071
6092
  }
6072
6093
  function Attribution(props) {
6073
6094
  const source = sourceOf(props);
6074
6095
  const value = react.useSyncExternalStore(source.subscribe, source.getSnapshot, source.getSnapshot);
6075
6096
  const [open, setOpen] = react.useState(false);
6097
+ react.useEffect(ensureAttributionStyle, []);
6076
6098
  if (!record$2(value) || typeof value.model !== "string" || typeof value.provider !== "string" || !sequence(value.candidateCount)) return null;
6077
6099
  const parsed = value;
6078
- return react.createElement("span", {
6079
- "data-copilot-auto-attribution": "",
6080
- style: {
6081
- display: "inline-flex",
6082
- alignItems: "center",
6083
- gap: 6,
6084
- color: "var(--text-muted, #667085)",
6085
- fontSize: 12
6086
- }
6087
- }, react.createElement("span", null, `Auto${parsed.preference === void 0 || parsed.preference === "balance" ? "" : ` (${parsed.preference})`} · ${parsed.model}`), react.createElement("button", {
6100
+ return react.createElement("span", { "data-copilot-auto-attribution": "" }, react.createElement("span", null, `Auto${parsed.preference === void 0 || parsed.preference === "balance" ? "" : ` (${parsed.preference})`} · ${parsed.model}`), react.createElement("button", {
6088
6101
  type: "button",
6089
6102
  "aria-label": "Why this model",
6090
6103
  "aria-expanded": open,