dsh-github-copilot 0.4.0-alpha.24 → 0.4.0-alpha.26

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
@@ -5366,6 +5366,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5366
5366
  return /* @__PURE__ */ _superRefine(fn, params);
5367
5367
  }
5368
5368
  //#endregion
5369
+ //#region lib/types/remote-codec.js
5370
+ /** Client-safe bridge between legacy schema codecs and alpha.2 create factories. */
5371
+ function strictRemoteCodec(typeSymbol, schema) {
5372
+ return {
5373
+ mode: "strict",
5374
+ typeSymbol,
5375
+ schema,
5376
+ create: () => schema
5377
+ };
5378
+ }
5379
+ //#endregion
5369
5380
  //#region lib/types/dual-model-remote.js
5370
5381
  const id = string().min(1).max(512);
5371
5382
  const revision = number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
@@ -5409,11 +5420,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5409
5420
  method: "view",
5410
5421
  invocation: { kind: "direct" },
5411
5422
  parameters: [],
5412
- result: {
5413
- mode: "strict",
5414
- typeSymbol: "dsh-github-copilot#DualModelView",
5415
- schema: DualModelViewSchema
5416
- }
5423
+ result: strictRemoteCodec("dsh-github-copilot#DualModelView", DualModelViewSchema)
5417
5424
  },
5418
5425
  {
5419
5426
  id: "dsh-github-copilot:githubCopilotDualModel.save",
@@ -5425,17 +5432,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5425
5432
  name: "input",
5426
5433
  wire: "input",
5427
5434
  source: "json",
5428
- codec: {
5429
- mode: "strict",
5430
- typeSymbol: "dsh-github-copilot#DualModelSaveRequest",
5431
- schema: DualModelSaveSchema
5432
- }
5435
+ codec: strictRemoteCodec("dsh-github-copilot#DualModelSaveRequest", DualModelSaveSchema)
5433
5436
  }],
5434
- result: {
5435
- mode: "strict",
5436
- typeSymbol: "dsh-github-copilot#DualModelView",
5437
- schema: DualModelViewSchema
5438
- }
5437
+ result: strictRemoteCodec("dsh-github-copilot#DualModelView", DualModelViewSchema)
5439
5438
  },
5440
5439
  {
5441
5440
  id: "dsh-github-copilot:githubCopilotDualModel.create",
@@ -5447,17 +5446,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5447
5446
  name: "input",
5448
5447
  wire: "input",
5449
5448
  source: "json",
5450
- codec: {
5451
- mode: "strict",
5452
- typeSymbol: "dsh-github-copilot#DualModelCreateRequest",
5453
- schema: DualModelCreateSchema
5454
- }
5449
+ codec: strictRemoteCodec("dsh-github-copilot#DualModelCreateRequest", DualModelCreateSchema)
5455
5450
  }],
5456
- result: {
5457
- mode: "strict",
5458
- typeSymbol: "dsh-github-copilot#DualModelCreateResult",
5459
- schema: DualModelCreateResultSchema
5460
- }
5451
+ result: strictRemoteCodec("dsh-github-copilot#DualModelCreateResult", DualModelCreateResultSchema)
5461
5452
  }
5462
5453
  ]
5463
5454
  };
@@ -5476,11 +5467,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5476
5467
  method: "providers",
5477
5468
  invocation: { kind: "direct" },
5478
5469
  parameters: [],
5479
- result: {
5480
- mode: "strict",
5481
- typeSymbol: "dsh-github-copilot#SearchProviderCatalog",
5482
- schema: SearchProviderCatalogSchema
5483
- }
5470
+ result: strictRemoteCodec("dsh-github-copilot#SearchProviderCatalog", SearchProviderCatalogSchema)
5484
5471
  }]
5485
5472
  };
5486
5473
  //#endregion
@@ -5560,11 +5547,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5560
5547
  }).strict().optional(),
5561
5548
  error: string().optional()
5562
5549
  }).strict();
5563
- const result = {
5564
- mode: "strict",
5565
- typeSymbol: GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL,
5566
- schema: GitHubCopilotAuthorizationViewSchema
5567
- };
5550
+ const result = strictRemoteCodec(GITHUB_COPILOT_AUTHORIZATION_VIEW_TYPE_SYMBOL, GitHubCopilotAuthorizationViewSchema);
5568
5551
  const GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL = "dsh-github-copilot#GitHubCopilotMigrationStatus";
5569
5552
  const selectionSchema = object({
5570
5553
  provider: string().min(1).max(512),
@@ -5638,11 +5621,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5638
5621
  method: "migrationStatus",
5639
5622
  invocation: direct,
5640
5623
  parameters: [],
5641
- result: {
5642
- mode: "strict",
5643
- typeSymbol: GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL,
5644
- schema: GitHubCopilotMigrationStatusSchema
5645
- }
5624
+ result: strictRemoteCodec(GITHUB_COPILOT_MIGRATION_STATUS_TYPE_SYMBOL, GitHubCopilotMigrationStatusSchema)
5646
5625
  },
5647
5626
  ...contribution$2.descriptors,
5648
5627
  ...contribution$1.descriptors
@@ -5915,6 +5894,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5915
5894
  };
5916
5895
  }
5917
5896
  //#endregion
5897
+ //#region lib/types/native-select-style.js
5898
+ const optionStyle = {
5899
+ backgroundColor: "var(--dsw-alias-bg-layer-1, Canvas)",
5900
+ color: "var(--dsw-alias-label-primary, CanvasText)"
5901
+ };
5902
+ const disabledOptionStyle = {
5903
+ ...optionStyle,
5904
+ color: "var(--dsw-alias-label-secondary, GrayText)"
5905
+ };
5906
+ const selectStyle = {
5907
+ ...optionStyle,
5908
+ width: "100%",
5909
+ minWidth: 0,
5910
+ boxSizing: "border-box",
5911
+ padding: "9px 11px",
5912
+ borderRadius: "9px",
5913
+ border: "1px solid var(--dsw-alias-border-l2, ButtonBorder)",
5914
+ font: "inherit"
5915
+ };
5916
+ const disabledSelectStyle = {
5917
+ ...selectStyle,
5918
+ color: "var(--dsw-alias-label-secondary, GrayText)"
5919
+ };
5920
+ function nativeSelectStyle(disabled = false) {
5921
+ return disabled ? disabledSelectStyle : selectStyle;
5922
+ }
5923
+ function nativeOptionStyle(disabled = false) {
5924
+ return disabled ? disabledOptionStyle : optionStyle;
5925
+ }
5926
+ //#endregion
5918
5927
  //#region lib/types/web-search-routing-card.js
5919
5928
  const GITHUB_COPILOT_SETTINGS_NAMESPACE = "github-copilot";
5920
5929
  const WEB_SEARCH_ROUTING_SETTINGS_NAMESPACE = "github-copilot-search-routing";
@@ -5936,7 +5945,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5936
5945
  gap: "6px",
5937
5946
  minWidth: 0
5938
5947
  };
5939
- const controlStyle$1 = {
5948
+ const controlStyle = {
5940
5949
  width: "100%",
5941
5950
  minWidth: 0,
5942
5951
  boxSizing: "border-box",
@@ -6170,11 +6179,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6170
6179
  ]);
6171
6180
  const providerOptions = () => providers.map((id) => (0, react.createElement)("option", {
6172
6181
  key: id,
6173
- value: id
6182
+ value: id,
6183
+ style: nativeOptionStyle()
6174
6184
  }, id));
6175
6185
  const unavailableOption = (id, known) => known ? null : (0, react.createElement)("option", {
6176
6186
  value: id,
6177
- disabled: true
6187
+ disabled: true,
6188
+ style: nativeOptionStyle(true)
6178
6189
  }, `${id || "(empty)"} — unavailable`);
6179
6190
  return (0, react.createElement)("section", {
6180
6191
  style: cardStyle$1,
@@ -6191,7 +6202,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6191
6202
  fontSize: "13px",
6192
6203
  fontWeight: 600
6193
6204
  } }, "Search provider"), (0, react.createElement)("select", {
6194
- style: controlStyle$1,
6205
+ style: nativeSelectStyle(disabled),
6195
6206
  disabled,
6196
6207
  value: draft.primary,
6197
6208
  "data-dsh-web-search-mode": true,
@@ -6202,11 +6213,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6202
6213
  primary
6203
6214
  }));
6204
6215
  }
6205
- }, (0, react.createElement)("option", { value: "auto" }, "Auto — follow Chat"), draft.primary === "none" ? (0, react.createElement)("option", { value: "none" }, "Disabled — saved configuration") : null, ...providerOptions(), unavailableOption(draft.primary, primaryKnown))), (0, react.createElement)("label", { style: fieldStyle$1 }, (0, react.createElement)("span", { style: {
6216
+ }, (0, react.createElement)("option", {
6217
+ value: "auto",
6218
+ style: nativeOptionStyle()
6219
+ }, "Auto — follow Chat"), draft.primary === "none" ? (0, react.createElement)("option", {
6220
+ value: "none",
6221
+ style: nativeOptionStyle()
6222
+ }, "Disabled — saved configuration") : null, ...providerOptions(), unavailableOption(draft.primary, primaryKnown))), (0, react.createElement)("label", { style: fieldStyle$1 }, (0, react.createElement)("span", { style: {
6206
6223
  fontSize: "13px",
6207
6224
  fontWeight: 600
6208
6225
  } }, "Default search provider"), (0, react.createElement)("select", {
6209
- style: controlStyle$1,
6226
+ style: nativeSelectStyle(disabled),
6210
6227
  disabled,
6211
6228
  value: draft.provider,
6212
6229
  "data-dsh-web-search-provider": true,
@@ -6217,7 +6234,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6217
6234
  provider
6218
6235
  }));
6219
6236
  }
6220
- }, (0, react.createElement)("option", { value: NO_DEFAULT_SEARCH_PROVIDER }, "None — no fallback"), ...providerOptions(), unavailableOption(draft.provider, fallbackKnown)), (0, react.createElement)("span", { style: hintStyle }, "Final fallback only: used when Auto has no matching provider or the primary search fails. The same provider is never retried as its own fallback.")), catalogReady && providers.length === 0 ? (0, react.createElement)("p", {
6237
+ }, (0, react.createElement)("option", {
6238
+ value: NO_DEFAULT_SEARCH_PROVIDER,
6239
+ style: nativeOptionStyle()
6240
+ }, "None — no fallback"), ...providerOptions(), unavailableOption(draft.provider, fallbackKnown)), (0, react.createElement)("span", { style: hintStyle }, "Final fallback only: used when Auto has no matching provider or the primary search fails. The same provider is never retried as its own fallback.")), catalogReady && providers.length === 0 ? (0, react.createElement)("p", {
6221
6241
  role: "status",
6222
6242
  style: hintStyle
6223
6243
  }, "No search providers are registered. Enable a search provider, then reload settings.") : null, catalogReady && missingProvider ? (0, react.createElement)("p", {
@@ -6227,7 +6247,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6227
6247
  fontSize: "13px",
6228
6248
  fontWeight: 600
6229
6249
  } }, "Copilot search model"), (0, react.createElement)("input", {
6230
- style: controlStyle$1,
6250
+ style: controlStyle,
6231
6251
  list: "dsh-copilot-search-models",
6232
6252
  disabled: disabled || missingCopilot,
6233
6253
  value: draft.model,
@@ -6421,17 +6441,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6421
6441
  fontSize: "13px",
6422
6442
  fontWeight: 600
6423
6443
  };
6424
- const controlStyle = {
6425
- width: "100%",
6426
- minWidth: 0,
6427
- boxSizing: "border-box",
6428
- padding: "9px 11px",
6429
- borderRadius: "9px",
6430
- color: "inherit",
6431
- border: "1px solid color-mix(in srgb, currentColor 24%, transparent)",
6432
- background: "color-mix(in srgb, currentColor 3%, transparent)",
6433
- font: "inherit"
6434
- };
6435
6444
  const buttonStyle = {
6436
6445
  padding: "9px 16px",
6437
6446
  maxWidth: "100%",
@@ -6630,7 +6639,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6630
6639
  style: labelStyle
6631
6640
  }, label), (0, react.createElement)("select", {
6632
6641
  id: `${id}-${role}`,
6633
- style: controlStyle,
6642
+ style: nativeSelectStyle(disabled),
6634
6643
  value,
6635
6644
  disabled,
6636
6645
  [`data-dsh-dual-model-${role}`]: true,
@@ -6647,13 +6656,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6647
6656
  }
6648
6657
  }, (0, react.createElement)("option", {
6649
6658
  value: "",
6650
- disabled: true
6659
+ disabled: true,
6660
+ style: nativeOptionStyle(true)
6651
6661
  }, t.selectModel), missing ? (0, react.createElement)("option", {
6652
6662
  value,
6653
- disabled: true
6663
+ disabled: true,
6664
+ style: nativeOptionStyle(true)
6654
6665
  }, `${value} (${t.unavailable})`) : null, ...models.map((model) => (0, react.createElement)("option", {
6655
6666
  key: model.id,
6656
- value: model.id
6667
+ value: model.id,
6668
+ style: nativeOptionStyle()
6657
6669
  }, model.name || model.id))));
6658
6670
  };
6659
6671
  const viewNotice = !view ? void 0 : !view.supported ? diagnostic(view.diagnostic) ?? "unsupported" : !view.writable ? "readonly" : !validRevision(view.revision) ? "revision" : void 0;
@@ -6710,7 +6722,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6710
6722
  style: labelStyle
6711
6723
  }, t.workspace), (0, react.createElement)("select", {
6712
6724
  id: `${id}-workspace`,
6713
- style: controlStyle,
6725
+ style: nativeSelectStyle(disabled),
6714
6726
  disabled,
6715
6727
  value: shownWorkspace,
6716
6728
  "data-dsh-dual-model-workspace": true,
@@ -6720,13 +6732,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6720
6732
  }
6721
6733
  }, (0, react.createElement)("option", {
6722
6734
  value: "",
6723
- disabled: true
6735
+ disabled: true,
6736
+ style: nativeOptionStyle(true)
6724
6737
  }, t.selectWorkspace), shownWorkspace && !view?.workspaces.some((item) => item.id === shownWorkspace) ? (0, react.createElement)("option", {
6725
6738
  value: shownWorkspace,
6726
- disabled: true
6739
+ disabled: true,
6740
+ style: nativeOptionStyle(true)
6727
6741
  }, `${shownWorkspace} (${t.unavailable})`) : null, ...(view?.workspaces ?? []).map((item) => (0, react.createElement)("option", {
6728
6742
  key: item.id,
6729
- value: item.id
6743
+ value: item.id,
6744
+ style: nativeOptionStyle()
6730
6745
  }, item.name || item.id))), view && view.workspaces.length === 0 ? (0, react.createElement)("p", { style: textStyle }, t.noWorkspaces) : null), viewNotice ? (0, react.createElement)("p", { style: textStyle }, t[viewNotice]) : null, !pending && view && !viewNotice ? (0, react.createElement)("p", { style: textStyle }, dirty ? t.dirty : !draft.enabled ? t.disabled : "") : null, (0, react.createElement)("div", { style: {
6731
6746
  display: "flex",
6732
6747
  gap: "12px",