dsh-github-copilot 0.4.0-alpha.100 → 0.4.0-alpha.102

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
@@ -2989,7 +2989,7 @@ function createAccountProvider(descriptors, guard, baseURL) {
2989
2989
  var package_default = {
2990
2990
  name: "dsh-github-copilot",
2991
2991
  description: "DSH companion for GitHub Copilot sign-in, account-aware model profiles, tool compatibility, and provider-hosted search.",
2992
- version: "0.4.0-alpha.100",
2992
+ version: "0.4.0-alpha.102",
2993
2993
  publishConfig: {
2994
2994
  "access": "public",
2995
2995
  "registry": "https://registry.npmjs.org/",
@@ -3282,11 +3282,7 @@ function migrationStatus(ctx) {
3282
3282
  const agents = api(ctx, "agents", ["list"]);
3283
3283
  const projections = api(ctx, "sessionProjections", ["stateOf"]);
3284
3284
  const defaults = api(ctx, "agentDefaultModel", ["currentSelection"]);
3285
- const settings = api(ctx, "settings", [
3286
- "describe",
3287
- "get",
3288
- "mutate"
3289
- ]);
3285
+ const settings = api(ctx, "settings", ["describe", "mutate"]);
3290
3286
  const llm = api(ctx, "llm", ["listProviders"]);
3291
3287
  result.capabilities.agentsList = agents !== void 0;
3292
3288
  result.capabilities.sessionProjections = projections !== void 0;
@@ -3342,15 +3338,17 @@ function migrationStatus(ctx) {
3342
3338
  if (settings) try {
3343
3339
  const descriptors = array(call(settings, "describe", { redactSecrets: true }));
3344
3340
  const found = /* @__PURE__ */ new Set();
3341
+ let providerConfig;
3345
3342
  for (const value of descriptors) {
3346
3343
  const descriptor = object$5(value);
3347
3344
  const ns = text$1(descriptor.ns);
3348
3345
  if (ns !== "llm-pi-ai" && ns !== "github-copilot") continue;
3349
3346
  if (found.has(ns) || !Number.isSafeInteger(descriptor.revision) || descriptor.revision < 0) throw new Error("Invalid settings evidence");
3350
3347
  found.add(ns);
3348
+ if (ns === "llm-pi-ai") providerConfig = descriptor.value;
3351
3349
  }
3352
3350
  if (found.size !== 2) throw new Error("Unregistered settings");
3353
- const config = object$5(call(settings, "get", "llm-pi-ai"));
3351
+ const config = object$5(typeof settings.get === "function" ? call(settings, "get", "llm-pi-ai") : providerConfig);
3354
3352
  const profile = (config.providers === void 0 ? void 0 : object$5(config.providers))?.[GITHUB_COPILOT_PROVIDER_ID];
3355
3353
  if (profile !== void 0) object$5(profile);
3356
3354
  result.capabilities.settingsCas = true;
@@ -3372,6 +3370,7 @@ function migrationStatus(ctx) {
3372
3370
  //#endregion
3373
3371
  //#region lib/types/copilot-accounts-types.js
3374
3372
  const COPILOT_ACCOUNT_ID_PATTERN = /^(?:canonical|[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$/u;
3373
+ const GITHUB_ACCOUNT_LOGIN_PATTERN = /^[a-zA-Z0-9](?:[a-zA-Z0-9_-]*[a-zA-Z0-9])?$/u;
3375
3374
  //#endregion
3376
3375
  //#region lib/types/copilot-accounts-host.js
3377
3376
  var __runInitializers$4 = function(thisArg, initializers, value) {
@@ -3723,7 +3722,7 @@ var CopilotAccountsHost = class {
3723
3722
  } catch {
3724
3723
  fail("COPILOT_ACCOUNTS_IDENTITY_INVALID");
3725
3724
  }
3726
- if (!object$4(value) || typeof value.login !== "string" || value.login.length > 39 || !/^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/u.test(value.login) || typeof value.id !== "number" || !Number.isSafeInteger(value.id) || value.id <= 0) fail("COPILOT_ACCOUNTS_IDENTITY_INVALID");
3725
+ if (!object$4(value) || typeof value.login !== "string" || value.login.length > 39 || !GITHUB_ACCOUNT_LOGIN_PATTERN.test(value.login) || typeof value.id !== "number" || !Number.isSafeInteger(value.id) || value.id <= 0) fail("COPILOT_ACCOUNTS_IDENTITY_INVALID");
3727
3726
  return Object.freeze({
3728
3727
  login: value.login,
3729
3728
  userId: value.id
package/lib/remote.js CHANGED
@@ -130,6 +130,7 @@ const COPILOT_USAGE_DIAGNOSTICS = [
130
130
  //#endregion
131
131
  //#region lib/types/copilot-accounts-types.js
132
132
  const COPILOT_ACCOUNT_ID_PATTERN = /^(?:canonical|[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12})$/u;
133
+ const GITHUB_ACCOUNT_LOGIN_PATTERN = /^[a-zA-Z0-9](?:[a-zA-Z0-9_-]*[a-zA-Z0-9])?$/u;
133
134
  const COPILOT_ACCOUNTS_DIAGNOSTICS = [
134
135
  "COPILOT_ACCOUNTS_SELECTOR_INVALID",
135
136
  "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE",
@@ -458,7 +459,7 @@ const CopilotAccountsViewSchema = z.object({
458
459
  "unknown"
459
460
  ]),
460
461
  identity: z.object({
461
- login: z.string().min(1).max(39).regex(/^[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/u),
462
+ login: z.string().min(1).max(39).regex(GITHUB_ACCOUNT_LOGIN_PATTERN),
462
463
  userId: z.number().int().positive().max(Number.MAX_SAFE_INTEGER)
463
464
  }).strict().optional()
464
465
  }).strict()).max(32),
@@ -1,5 +1,6 @@
1
1
  export declare const COPILOT_ACCOUNT_ID_PATTERN: RegExp;
2
2
  export declare const COPILOT_ACCOUNTS_MAX = 32;
3
+ export declare const GITHUB_ACCOUNT_LOGIN_PATTERN: RegExp;
3
4
  export declare const COPILOT_ACCOUNTS_DIAGNOSTICS: readonly ["COPILOT_ACCOUNTS_SELECTOR_INVALID", "COPILOT_ACCOUNTS_SETTINGS_UNAVAILABLE", "COPILOT_ACCOUNTS_SELECTED_MISSING", "COPILOT_ACCOUNTS_CREDENTIALS_UNAVAILABLE", "COPILOT_ACCOUNTS_CHANGED", "COPILOT_ACCOUNTS_BUSY", "COPILOT_ACCOUNTS_CONFLICT", "COPILOT_ACCOUNTS_COMMIT_UNCERTAIN", "COPILOT_ACCOUNTS_MODELS_FAILED", "COPILOT_ACCOUNTS_IDENTITY_UNAVAILABLE", "COPILOT_ACCOUNTS_IDENTITY_INVALID", "COPILOT_ACCOUNTS_IDENTITY_CHANGED", "COPILOT_ACCOUNTS_DUPLICATE", "COPILOT_ACCOUNTS_ENTERPRISE_UNSUPPORTED", "COPILOT_ACCOUNTS_ROUTE_BLOCKED", "COPILOT_ACCOUNTS_EVIDENCE_INCOMPLETE", "COPILOT_ACCOUNTS_LIMIT", "COPILOT_ACCOUNTS_AUTH_FAILED", "COPILOT_ACCOUNTS_AUTH_UNAVAILABLE", "COPILOT_ACCOUNTS_ACTIVE_REMOVE_BLOCKED", "COPILOT_ACCOUNTS_REMOVE_FAILED", "COPILOT_ACCOUNTS_DISPOSED"];
4
5
  export type CopilotAccountsDiagnostic = typeof COPILOT_ACCOUNTS_DIAGNOSTICS[number];
5
6
  export interface CopilotAccountIdentity {
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.100",
4
+ "version": "0.4.0-alpha.102",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "registry": "https://registry.npmjs.org/",