agl 43.6.0 → 43.7.0

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.
Files changed (67) hide show
  1. package/changelog.md +10 -0
  2. package/dist_serve/bundle.js +1801 -1783
  3. package/dist_serve/bundle.js.map +2 -2
  4. package/dist_ts/00_commitinfo_data.js +1 -1
  5. package/dist_ts/classes.accountsactions.d.ts +3 -1
  6. package/dist_ts/classes.accountsactions.js +17 -1
  7. package/dist_ts/classes.controller.d.ts +3 -3
  8. package/dist_ts/classes.controller.js +5 -4
  9. package/dist_ts/classes.inferencerouter.d.ts +21 -3
  10. package/dist_ts/classes.inferencerouter.js +40 -17
  11. package/dist_ts/classes.inferenceservice.js +2 -2
  12. package/dist_ts/functions.inferencecli.js +2 -1
  13. package/dist_ts/interfaces.auth.d.ts +1 -1
  14. package/dist_ts/interfaces.auth.js +2 -1
  15. package/dist_ts/plugins.d.ts +2 -1
  16. package/dist_ts/plugins.js +4 -2
  17. package/dist_ts_authswitch/authority-contract.d.ts +26 -0
  18. package/dist_ts_authswitch/authority-contract.js +1 -1
  19. package/dist_ts_authswitch/authority-overview.d.ts +8 -0
  20. package/dist_ts_authswitch/authority-overview.js +10 -4
  21. package/dist_ts_authswitch/authority-placement.d.ts +16 -9
  22. package/dist_ts_authswitch/authority-placement.js +10 -7
  23. package/dist_ts_authswitch/authority-priority.d.ts +20 -0
  24. package/dist_ts_authswitch/authority-priority.js +21 -0
  25. package/dist_ts_authswitch/classes.authoritybroker.d.ts +7 -0
  26. package/dist_ts_authswitch/classes.authoritybroker.js +26 -2
  27. package/dist_ts_authswitch/classes.authoritycli.d.ts +1 -0
  28. package/dist_ts_authswitch/classes.authoritycli.js +43 -3
  29. package/dist_ts_authswitch/classes.authorityclient.d.ts +6 -1
  30. package/dist_ts_authswitch/classes.authorityclient.js +12 -4
  31. package/dist_ts_authswitch/classes.authoritydaemon.js +7 -1
  32. package/dist_ts_authswitch/classes.authoritydatabase.d.ts +6 -0
  33. package/dist_ts_authswitch/classes.authoritydatabase.js +13 -2
  34. package/dist_ts_authswitch/classes.authoritymodels.d.ts +7 -0
  35. package/dist_ts_authswitch/classes.authoritymodels.js +17 -8
  36. package/dist_ts_interfaces/requests.accounts.d.ts +19 -0
  37. package/dist_ts_interfaces/requests.accounts.js +1 -1
  38. package/dist_ts_interfaces/requests.d.ts +2 -2
  39. package/dist_ts_interfaces/requests.js +1 -1
  40. package/docs/authswitch.md +25 -0
  41. package/package.json +1 -1
  42. package/readme.md +29 -5
  43. package/ts/00_commitinfo_data.ts +1 -1
  44. package/ts/classes.accountsactions.ts +25 -0
  45. package/ts/classes.controller.ts +4 -3
  46. package/ts/classes.inferencerouter.ts +61 -16
  47. package/ts/classes.inferenceservice.ts +1 -1
  48. package/ts/functions.inferencecli.ts +1 -0
  49. package/ts/interfaces.auth.ts +1 -0
  50. package/ts/plugins.ts +3 -0
  51. package/ts_authswitch/authority-contract.ts +21 -0
  52. package/ts_authswitch/authority-overview.ts +19 -5
  53. package/ts_authswitch/authority-placement.ts +18 -10
  54. package/ts_authswitch/authority-priority.ts +25 -0
  55. package/ts_authswitch/classes.authoritybroker.ts +26 -1
  56. package/ts_authswitch/classes.authoritycli.ts +48 -2
  57. package/ts_authswitch/classes.authorityclient.ts +14 -4
  58. package/ts_authswitch/classes.authoritydaemon.ts +8 -1
  59. package/ts_authswitch/classes.authoritydatabase.ts +11 -1
  60. package/ts_authswitch/classes.authoritymodels.ts +17 -6
  61. package/ts_authswitch/readme.md +1 -1
  62. package/ts_interfaces/requests.accounts.ts +17 -0
  63. package/ts_interfaces/requests.ts +2 -0
  64. package/ts_web/00_commitinfo_data.ts +1 -1
  65. package/ts_web/accounts.plugins.ts +4 -2
  66. package/ts_web/classes.accountsreadmodel.ts +36 -2
  67. package/ts_web/elements.accounts.ts +48 -0
@@ -39,6 +39,12 @@ export interface IInferenceAccount {
39
39
  * without one. Placement only: a window's usage counts as spent by the next renewal (`authSwitchPlacement`).
40
40
  */
41
41
  renewsAt: string | null;
42
+ /**
43
+ * When the owner's priority on the account ends (`IAuthSwitchAccount.priorityUntil`, AGL-1809); `null` without one.
44
+ * While it holds at the moment of placing (`authSwitchPriorityActive`), a new session goes to the account before any
45
+ * account of the pool without one, as long as it takes the request (`inferencePlacementOrder`).
46
+ */
47
+ priorityUntil: string | null;
42
48
  /**
43
49
  * An API key's monthly spend limit in micro-dollars (`IAuthSwitchAccount.spendLimitMicroUsd`); `null` without one,
44
50
  * and for a sign-in. It decides only whether a key whose spend the proxy holds no reading of may take work: one with
@@ -351,6 +357,11 @@ export interface IInferenceAccountStatus {
351
357
  * without one. Placement ignores it while the account has a lapse date. A proxy of an earlier AGL reports none.
352
358
  */
353
359
  renewal?: plugins.authswitchRenewal.IAuthSwitchRenewal | null;
360
+ /**
361
+ * When the owner's priority on the account ends, while it holds now (`IInferenceAccount.priorityUntil`), or `null`: the
362
+ * account ranks before every account without one. A proxy of an earlier AGL reports none.
363
+ */
364
+ priorityUntil?: string | null;
354
365
  /** The account's placement score in percent per hour (`IAuthSwitchPlacement.score`); `null` without a counted window. */
355
366
  placementScore: number | null;
356
367
  /**
@@ -565,6 +576,13 @@ export declare class InferenceRouter {
565
576
  * goes back to a ChatGPT account as soon as one can take its request, and the route says so (`returned`).
566
577
  */
567
578
  acquire(modelIdArg: string, policyArg: IInferenceRoutingPolicy, signalArg: AbortSignal, optionsArg?: IInferenceAcquireOptions): Promise<IInferenceRoute>;
579
+ /**
580
+ * The accounts of the pool a session on `pinnedArg`, of a later credential tier, returns to (`returnToBetterTier`): those
581
+ * of a better tier, as a new session would be placed. A session on a priority account (AGL-1809) returns only to a
582
+ * priority account of a better tier, since a new session would go to its own account before any account without one;
583
+ * a priority is judged now.
584
+ */
585
+ private betterTier;
568
586
  /** `acquire` among `accountsArg`, the pool's accounts or those of its better tiers. */
569
587
  private routeOpenAi;
570
588
  /**
@@ -624,9 +642,9 @@ export declare class InferenceRouter {
624
642
  */
625
643
  private rejectApiKey;
626
644
  /**
627
- * The candidate a request goes to -- of the best credential tier, then by the placement order
628
- * (`authSwitchPlacementOrder`) -- or the refusal that says why there is none. A pinned request has its session's
629
- * account as its one candidate, so the order only ever places new sessions. An account at its reserve is refused like one at its limit, and the refusal names the reserve. A pinned account
645
+ * The candidate a request goes to -- a priority account before any other, then of the best credential tier, then by
646
+ * the placement order (`inferencePlacementOrder`) -- or the refusal that says why there is none. A pinned request has
647
+ * its session's account as its one candidate, so the order only ever places new sessions. An account at its reserve is refused like one at its limit, and the refusal names the reserve. A pinned account
630
648
  * that takes no request for a reason of its own (`refusal`) is refused with that account and reason.
631
649
  */
632
650
  private select;