@modelprofile.com/authswitch 3.2.0 → 4.0.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 (87) hide show
  1. package/dist_ts/00_commitinfo_data.js +3 -3
  2. package/dist_ts/accounts.d.ts +63 -13
  3. package/dist_ts/accounts.js +199 -31
  4. package/dist_ts/classes.accountlist.d.ts +0 -24
  5. package/dist_ts/classes.accountlist.js +2 -213
  6. package/dist_ts/classes.claudecodeharness.d.ts +61 -3
  7. package/dist_ts/classes.claudecodeharness.js +130 -14
  8. package/dist_ts/classes.claudecodelocks.d.ts +35 -0
  9. package/dist_ts/classes.claudecodelocks.js +117 -0
  10. package/dist_ts/classes.claudestatus.d.ts +17 -4
  11. package/dist_ts/classes.claudestatus.js +89 -73
  12. package/dist_ts/classes.claudetokenrefresh.d.ts +32 -0
  13. package/dist_ts/classes.claudetokenrefresh.js +77 -0
  14. package/dist_ts/classes.cli.d.ts +29 -7
  15. package/dist_ts/classes.cli.js +172 -78
  16. package/dist_ts/classes.codexharness.d.ts +6 -2
  17. package/dist_ts/classes.codexharness.js +7 -3
  18. package/dist_ts/classes.codexstatus.d.ts +5 -4
  19. package/dist_ts/classes.codexstatus.js +36 -19
  20. package/dist_ts/classes.credentialstore.d.ts +28 -2
  21. package/dist_ts/classes.credentialstore.js +41 -12
  22. package/dist_ts/classes.fileharness.d.ts +39 -19
  23. package/dist_ts/classes.fileharness.js +58 -24
  24. package/dist_ts/classes.limits.d.ts +46 -7
  25. package/dist_ts/classes.limits.js +106 -32
  26. package/dist_ts/classes.listrenderer.d.ts +17 -0
  27. package/dist_ts/classes.listrenderer.js +313 -0
  28. package/dist_ts/classes.login.d.ts +1 -1
  29. package/dist_ts/classes.login.js +1 -1
  30. package/dist_ts/classes.opencodeharness.d.ts +6 -2
  31. package/dist_ts/classes.opencodeharness.js +9 -5
  32. package/dist_ts/classes.operations.js +3 -2
  33. package/dist_ts/classes.tui.js +10 -6
  34. package/dist_ts/classes.watch.d.ts +108 -0
  35. package/dist_ts/classes.watch.js +219 -0
  36. package/dist_ts/classes.watchlock.d.ts +33 -0
  37. package/dist_ts/classes.watchlock.js +118 -0
  38. package/dist_ts/claudehttp.d.ts +39 -0
  39. package/dist_ts/claudehttp.js +83 -0
  40. package/dist_ts/cliargs.d.ts +36 -0
  41. package/dist_ts/cliargs.js +60 -0
  42. package/dist_ts/consoletable.d.ts +21 -0
  43. package/dist_ts/consoletable.js +63 -0
  44. package/dist_ts/helpers.d.ts +7 -0
  45. package/dist_ts/helpers.js +16 -1
  46. package/dist_ts/index.d.ts +3 -0
  47. package/dist_ts/index.js +4 -1
  48. package/dist_ts/interfaces.harness.d.ts +76 -15
  49. package/dist_ts/interfaces.list.d.ts +7 -1
  50. package/dist_ts/plugins.d.ts +7 -0
  51. package/dist_ts/plugins.js +6 -1
  52. package/dist_ts/ratelimit.d.ts +8 -0
  53. package/dist_ts/ratelimit.js +13 -0
  54. package/dist_ts/watchpolicy.d.ts +44 -0
  55. package/dist_ts/watchpolicy.js +82 -0
  56. package/package.json +5 -3
  57. package/readme.md +360 -106
  58. package/ts/00_commitinfo_data.ts +3 -3
  59. package/ts/accounts.ts +202 -34
  60. package/ts/classes.accountlist.ts +2 -216
  61. package/ts/classes.claudecodeharness.ts +126 -13
  62. package/ts/classes.claudecodelocks.ts +132 -0
  63. package/ts/classes.claudestatus.ts +88 -54
  64. package/ts/classes.claudetokenrefresh.ts +85 -0
  65. package/ts/classes.cli.ts +163 -63
  66. package/ts/classes.codexharness.ts +7 -3
  67. package/ts/classes.codexstatus.ts +29 -18
  68. package/ts/classes.credentialstore.ts +53 -9
  69. package/ts/classes.fileharness.ts +69 -31
  70. package/ts/classes.limits.ts +126 -33
  71. package/ts/classes.listrenderer.ts +328 -0
  72. package/ts/classes.login.ts +1 -1
  73. package/ts/classes.opencodeharness.ts +9 -5
  74. package/ts/classes.operations.ts +2 -1
  75. package/ts/classes.tui.ts +9 -5
  76. package/ts/classes.watch.ts +263 -0
  77. package/ts/classes.watchlock.ts +100 -0
  78. package/ts/claudehttp.ts +92 -0
  79. package/ts/cliargs.ts +71 -0
  80. package/ts/consoletable.ts +62 -0
  81. package/ts/helpers.ts +14 -0
  82. package/ts/index.ts +3 -0
  83. package/ts/interfaces.harness.ts +78 -6
  84. package/ts/interfaces.list.ts +7 -1
  85. package/ts/plugins.ts +9 -0
  86. package/ts/ratelimit.ts +14 -0
  87. package/ts/watchpolicy.ts +121 -0
@@ -19,14 +19,21 @@ export declare class AuthSwitchCli {
19
19
  * Decide what happens to the harness's own running instances before its credential file changes.
20
20
  *
21
21
  * The switch itself no longer depends on this: it writes atomically and re-saves the outgoing
22
- * login either way. What a running instance still costs is durability -- it holds the previous
23
- * login in memory and can write it back at its next refresh -- so the instances are named and
24
- * stopping them is offered, never assumed. Without a terminal and without a flag nothing is
25
- * signalled, and only pids enumerated here for this user are ever signalled at all.
22
+ * login either way. A harness that picks up swaps live needs nothing here, so its instances are
23
+ * only stopped on an explicit --stop or --force-stop. Any other running instance still costs
24
+ * durability -- it holds the previous login in memory and can write it back at its next refresh --
25
+ * so the instances are named and stopping them is offered, never assumed. Without a terminal and
26
+ * without a flag nothing is signalled, and only pids enumerated here for this user are ever
27
+ * signalled at all.
26
28
  */
27
29
  private settleRunningInstances;
28
30
  private commandLogin;
29
31
  private commandPreuse;
32
+ /**
33
+ * Watch usage and switch automatically; see `AuthSwitchWatch`. SIGINT and SIGTERM end it cleanly with status 0.
34
+ * `--once` runs one check and exits 1 when a switch it attempted did not complete.
35
+ */
36
+ private commandWatch;
30
37
  private selectHarness;
31
38
  private runInteractive;
32
39
  /** Offer a verified save before presenting the switch picker; declining never switches. */
@@ -36,13 +43,28 @@ export declare class AuthSwitchCli {
36
43
  private selectActive;
37
44
  private reportOutcome;
38
45
  /**
39
- * The condensed views are projections of the same read-only account list, so a provider is queried
40
- * once, per account, with the same bounded timeouts and per-account failure isolation as `list`.
46
+ * The condensed views are projections of the same account list, which never changes which account is in
47
+ * use, so a provider is queried once, per account, with the same bounded timeouts and per-account failure
48
+ * isolation as `list`.
41
49
  */
42
50
  private commandCondensed;
43
51
  private commandList;
44
- private printAccount;
45
52
  private resolveAccount;
53
+ /**
54
+ * Activate a saved account and report what is now active with its badge.
55
+ *
56
+ * The badge is read once per command through the bounded status read: the chooser reads it before it
57
+ * offers the accounts and the report repeats it, while a target named on the command line is read only
58
+ * after its switch, so nothing waits on it. A read that fails or does not answer in time leaves the name
59
+ * alone and never decides the outcome.
60
+ */
46
61
  private commandUse;
62
+ /**
63
+ * A switch target named on the command line; its badge is not read here, so the switch never waits on it.
64
+ *
65
+ * The reference already resolved to this id, so the name is presentation only: a state read that fails
66
+ * names the account by its id and leaves the switch, which reports any real credential problem, to run.
67
+ */
68
+ private namedAccount;
47
69
  private promptForAccount;
48
70
  }