dsh-github-copilot 0.4.0-alpha.50 → 0.4.0-alpha.52

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/index.js CHANGED
@@ -1622,7 +1622,7 @@ let GitHubCopilotUsageController = (() => {
1622
1622
  //#endregion
1623
1623
  //#region package.json
1624
1624
  var name$1 = "dsh-github-copilot";
1625
- var version = "0.4.0-alpha.50";
1625
+ var version = "0.4.0-alpha.52";
1626
1626
  //#endregion
1627
1627
  //#region lib/types/probe.js
1628
1628
  /**
@@ -7115,27 +7115,29 @@ var ConfiguredSearchProofInvalidated = class extends WebError {
7115
7115
  super("configured Copilot search owner or account proof invalidated", "WEB_PROVIDER_UNAVAILABLE");
7116
7116
  }
7117
7117
  };
7118
- function isInstanceSettingsInstaller(value) {
7119
- return typeof value === "object" && value !== null && "installSection" in value && typeof value.installSection === "function";
7120
- }
7121
7118
  function installSettingsNamespace(ctx, namespace, schema, config, hooks) {
7122
7119
  const legacyInstaller = dshSettings.installSettingsSection;
7123
7120
  if (legacyInstaller !== void 0) {
7124
7121
  legacyInstaller(ctx, namespace, schema, config, hooks);
7125
7122
  return;
7126
7123
  }
7127
- ctx.inject(["settings"], (settingsCtx) => {
7128
- if (isInstanceSettingsInstaller(settingsCtx.settings)) {
7129
- settingsCtx.settings.installSection(ctx, namespace, schema, config, hooks);
7130
- return;
7131
- }
7132
- const fallback = namespace === "github-copilot-search-routing" ? (typeof config === "object" && config !== null ? config : void 0)?.searchRouting ?? {} : config;
7124
+ ctx.inject(["settings"], () => {
7133
7125
  hooks.setSource(() => {
7134
- return readSettingsNamespace(ctx, namespace) ?? fallback;
7126
+ const value = readSettingsNamespace(ctx, namespace);
7127
+ if (typeof value !== "object" || value === null) return config;
7128
+ const merged = {
7129
+ ...typeof config === "object" && config !== null ? config : {},
7130
+ ...value
7131
+ };
7132
+ if (typeof schema === "function") try {
7133
+ return schema(merged);
7134
+ } catch {
7135
+ return merged;
7136
+ }
7137
+ return merged;
7135
7138
  });
7136
- const watched = namespace === "github-copilot-search-routing" ? /* @__PURE__ */ new Set([namespace, GITHUB_COPILOT_SETTINGS_NAMESPACE]) : /* @__PURE__ */ new Set([namespace]);
7137
7139
  const dispose = onSettingsNamespaceUpdated(ctx, (changed) => {
7138
- if (watched.has(changed)) hooks.onChange();
7140
+ if (changed === namespace || namespace === "github-copilot" && changed === "github-copilot-search-routing") hooks.onChange();
7139
7141
  });
7140
7142
  ctx.effect(() => dispose);
7141
7143
  });
@@ -7185,10 +7187,13 @@ function ensureAuthorization(ctx) {
7185
7187
  function activate(ctx, config) {
7186
7188
  assertDshCompatibility(ctx);
7187
7189
  let current = () => config;
7188
- let routingCurrent = () => ({
7189
- searchMode: "auto",
7190
- defaultSearchProvider: "deepseek-official"
7191
- });
7190
+ const readRouting = () => {
7191
+ const rawRouting = readSettingsNamespace(ctx, GITHUB_COPILOT_SETTINGS_NAMESPACE)?.searchRouting;
7192
+ if (rawRouting && (rawRouting.searchProvider !== void 0 || rawRouting.defaultSearchProvider !== void 0 || rawRouting.searchMode !== void 0)) return rawRouting;
7193
+ const legacy = readSettingsNamespace(ctx, WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE);
7194
+ if (legacy && (legacy.searchProvider !== void 0 || legacy.defaultSearchProvider !== void 0 || legacy.searchMode !== void 0)) return legacy;
7195
+ return current().searchRouting ?? {};
7196
+ };
7192
7197
  ctx.plugin(preview_route_default, {
7193
7198
  accountModelSettings: () => current(),
7194
7199
  requestBudgetSettings: () => {
@@ -7475,7 +7480,7 @@ function activate(ctx, config) {
7475
7480
  ctx.web.registerSearchProvider(traditionalProvider);
7476
7481
  ctx.provide("githubCopilotSearchRouter", { search: async (request, signal, delegate, selectProvider, captureSearchProvider) => {
7477
7482
  const cfg = current();
7478
- const routing = routingCurrent();
7483
+ const routing = readRouting();
7479
7484
  const policy = normalizeWebSearchRouting(routing);
7480
7485
  const owner = currentSearchInitiator(ctx);
7481
7486
  const selection = currentSearchSelection(owner);
@@ -7581,19 +7586,13 @@ function activate(ctx, config) {
7581
7586
  },
7582
7587
  onChange: invalidatePlans
7583
7588
  });
7584
- installSettingsNamespace(ctx, WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE, WebSearchRoutingConfigSchema, {}, {
7585
- setSource: (source) => {
7586
- routingCurrent = source;
7587
- },
7588
- onChange: invalidatePlans
7589
- });
7590
7589
  ensureGitHubCopilotProviderProfile(ctx).catch((error) => {
7591
7590
  ctx.logger.error("github-copilot: failed to repair the GitHub Copilot provider route during startup");
7592
7591
  ctx.logger.error(error);
7593
7592
  });
7594
7593
  ctx.on("llm/stream", (request, next) => {
7595
7594
  const cfg = current();
7596
- if (!active || normalizeWebSearchRouting(routingCurrent()).primaryProvider !== "auto") return next();
7595
+ if (!active || normalizeWebSearchRouting(readRouting()).primaryProvider !== "auto") return next();
7597
7596
  const owner = currentSearchInitiator(ctx);
7598
7597
  if (owner !== void 0 && disposedOwners.has(owner)) return next();
7599
7598
  const route = currentChatRoute(ctx, request);
@@ -7612,7 +7611,7 @@ function activate(ctx, config) {
7612
7611
  text: () => ""
7613
7612
  });
7614
7613
  return (owner, selection) => {
7615
- const policy = normalizeWebSearchRouting(routingCurrent());
7614
+ const policy = normalizeWebSearchRouting(readRouting());
7616
7615
  if (!active || owner === void 0 || disposedOwners.has(owner) || policy.primaryProvider !== "auto") return "";
7617
7616
  const route = currentChatRoute(ctx, selection);
7618
7617
  const cfg = current();
@@ -38,6 +38,8 @@ export declare const autoModelAttributionDefinition: {
38
38
  }): AttributionState;
39
39
  buildLocationData(context: Context, scope: string, previous: LocationData | null): LocationData | null;
40
40
  };
41
+ /** Inline footer chrome: after the settled clock, hidden until the message is hovered. */
42
+ export declare const AUTO_ATTRIBUTION_STYLE: string;
41
43
  export declare function installAutoModelPresentation(capabilities: {
42
44
  readonly slots: unknown;
43
45
  readonly uiConversation: unknown;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-github-copilot",
3
3
  "description": "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
4
- "version": "0.4.0-alpha.50",
4
+ "version": "0.4.0-alpha.52",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",