sidekick-shared 0.27.4 → 0.27.6

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 (64) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +92 -45
  3. package/dist/accountHealth.d.ts +14 -0
  4. package/dist/accountHealth.js +61 -14
  5. package/dist/accountLaunch.d.ts +6 -0
  6. package/dist/accountLaunch.js +61 -4
  7. package/dist/accountLease.d.ts +5 -0
  8. package/dist/accountLease.js +98 -0
  9. package/dist/accountManager.d.ts +7 -0
  10. package/dist/accountManager.js +226 -89
  11. package/dist/accountSync.d.ts +1 -5
  12. package/dist/accountSync.js +22 -6
  13. package/dist/accountSyncTypes.d.ts +9 -0
  14. package/dist/accounts.d.ts +75 -18
  15. package/dist/accounts.js +712 -189
  16. package/dist/claudeCredentialDoctor.d.ts +50 -0
  17. package/dist/claudeCredentialDoctor.js +277 -0
  18. package/dist/claudeCredentialLedger.d.ts +15 -0
  19. package/dist/claudeCredentialLedger.js +130 -0
  20. package/dist/claudeCredentials.d.ts +20 -3
  21. package/dist/claudeCredentials.js +50 -3
  22. package/dist/claudeLiveGuard.d.ts +33 -0
  23. package/dist/claudeLiveGuard.js +46 -0
  24. package/dist/claudeProfiles.d.ts +14 -0
  25. package/dist/claudeProfiles.js +22 -0
  26. package/dist/claudeRefreshLock.d.ts +15 -0
  27. package/dist/claudeRefreshLock.js +145 -0
  28. package/dist/codexAuth.d.ts +4 -0
  29. package/dist/codexAuth.js +18 -0
  30. package/dist/codexCredentialDoctor.d.ts +33 -0
  31. package/dist/codexCredentialDoctor.js +302 -0
  32. package/dist/codexCredentialStore.d.ts +29 -0
  33. package/dist/codexCredentialStore.js +213 -0
  34. package/dist/codexKeepAlive.d.ts +2 -0
  35. package/dist/codexKeepAlive.js +116 -0
  36. package/dist/codexPaths.d.ts +8 -2
  37. package/dist/codexPaths.js +51 -7
  38. package/dist/codexProfiles.d.ts +37 -31
  39. package/dist/codexProfiles.js +842 -671
  40. package/dist/credentialIO.d.ts +67 -7
  41. package/dist/credentialIO.js +211 -47
  42. package/dist/ensureDefaultAccounts.js +1 -8
  43. package/dist/index.d.ts +17 -4
  44. package/dist/index.js +36 -11
  45. package/dist/keepAlive.d.ts +2 -1
  46. package/dist/keepAlive.js +116 -29
  47. package/dist/liveCredentialGuard.d.ts +28 -0
  48. package/dist/liveCredentialGuard.js +36 -0
  49. package/dist/node.d.ts +3 -0
  50. package/dist/node.js +4 -2
  51. package/dist/processDetection.d.ts +10 -3
  52. package/dist/processDetection.js +44 -11
  53. package/dist/promptHistory.d.ts +66 -0
  54. package/dist/promptHistory.js +37 -18
  55. package/dist/schemas/accountManager.d.ts +22 -0
  56. package/dist/schemas/accountManager.js +4 -0
  57. package/dist/schemas/assistantTurn.d.ts +2 -2
  58. package/dist/sessionPromptHistory.d.ts +120 -0
  59. package/dist/sessionPromptHistory.js +278 -0
  60. package/dist/sessionPromptSignals.d.ts +56 -0
  61. package/dist/sessionPromptSignals.js +355 -0
  62. package/dist/terminalSync.d.ts +12 -2
  63. package/dist/terminalSync.js +27 -2
  64. package/package.json +1 -1
@@ -1,7 +1,17 @@
1
1
  import type { AccountProviderId } from './accountRegistry';
2
2
  /**
3
- * Write a POSIX launcher script that runs the provider CLI against a profile
4
- * home. Unix only; on Windows use `sidekick accounts env --shell powershell`.
3
+ * Write a POSIX launcher script that runs the provider CLI as a saved account.
4
+ * The script defers to `sidekick accounts shell` at run time, which resolves
5
+ * the right home then: the account's profile home while it is inactive, the
6
+ * live home while it is the live login (a session pinned to the profile home
7
+ * would otherwise be a second copy of the live login). Unix only; on Windows
8
+ * use `sidekick accounts env --shell powershell`.
9
+ */
10
+ export declare function writeAccountLauncher(name: string, provider: AccountProviderId, accountId: string): void;
11
+ /**
12
+ * @deprecated Pins a launcher to one profile home; when that account becomes
13
+ * the live login the launcher runs a second copy of it. Use
14
+ * {@link writeAccountLauncher}.
5
15
  */
6
16
  export declare function writeLauncher(name: string, provider: AccountProviderId, profileHome: string): void;
7
17
  export declare function removeLauncher(name: string): void;
@@ -33,6 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.writeAccountLauncher = writeAccountLauncher;
36
37
  exports.writeLauncher = writeLauncher;
37
38
  exports.removeLauncher = removeLauncher;
38
39
  const fs = __importStar(require("fs"));
@@ -79,9 +80,33 @@ function assertNoLauncherCollision(name, targetPath) {
79
80
  }
80
81
  }
81
82
  }
83
+ function shellSingleQuote(value) {
84
+ return `'${value.replace(/'/g, `'\\''`)}'`;
85
+ }
86
+ /**
87
+ * Write a POSIX launcher script that runs the provider CLI as a saved account.
88
+ * The script defers to `sidekick accounts shell` at run time, which resolves
89
+ * the right home then: the account's profile home while it is inactive, the
90
+ * live home while it is the live login (a session pinned to the profile home
91
+ * would otherwise be a second copy of the live login). Unix only; on Windows
92
+ * use `sidekick accounts env --shell powershell`.
93
+ */
94
+ function writeAccountLauncher(name, provider, accountId) {
95
+ assertValidLauncherName(name);
96
+ const launcherPath = getLauncherPath(name);
97
+ assertNoLauncherCollision(name, launcherPath);
98
+ const script = [
99
+ '#!/bin/sh',
100
+ LAUNCHER_MARKER,
101
+ `exec sidekick accounts shell --provider ${provider} ${shellSingleQuote(accountId)} -- ${providerBinary(provider)} "$@"`,
102
+ '',
103
+ ].join('\n');
104
+ (0, atomic_1.atomicWriteFileSync)(launcherPath, script, 0o755);
105
+ }
82
106
  /**
83
- * Write a POSIX launcher script that runs the provider CLI against a profile
84
- * home. Unix only; on Windows use `sidekick accounts env --shell powershell`.
107
+ * @deprecated Pins a launcher to one profile home; when that account becomes
108
+ * the live login the launcher runs a second copy of it. Use
109
+ * {@link writeAccountLauncher}.
85
110
  */
86
111
  function writeLauncher(name, provider, profileHome) {
87
112
  assertValidLauncherName(name);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sidekick-shared",
3
- "version": "0.27.4",
3
+ "version": "0.27.6",
4
4
  "description": "Shared data access layer for Sidekick — readers, types, providers, credentials, quota",
5
5
  "keywords": [
6
6
  "claude-code",