@phnx-labs/agents-cli 1.22.41 → 1.22.43

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 (253) hide show
  1. package/CHANGELOG.md +86 -0
  2. package/README.md +10 -4
  3. package/dist/bin/agents +0 -0
  4. package/dist/bootstrap.js +25 -7
  5. package/dist/cli/command-registry.d.ts +2 -3
  6. package/dist/cli/command-registry.js +4 -8
  7. package/dist/commands/accounts.d.ts +29 -0
  8. package/dist/commands/accounts.js +220 -29
  9. package/dist/commands/alias.d.ts +7 -4
  10. package/dist/commands/alias.js +34 -9
  11. package/dist/commands/auth.d.ts +9 -0
  12. package/dist/commands/auth.js +108 -0
  13. package/dist/commands/browser-sessions-picker.js +42 -62
  14. package/dist/commands/browser.js +30 -38
  15. package/dist/commands/computer-actions.d.ts +1 -1
  16. package/dist/commands/computer-actions.js +1 -1
  17. package/dist/commands/computer-sessions-picker.js +32 -55
  18. package/dist/commands/computer.d.ts +1 -1
  19. package/dist/commands/computer.js +22 -8
  20. package/dist/commands/daemon.js +1 -1
  21. package/dist/commands/doctor.d.ts +5 -3
  22. package/dist/commands/doctor.js +23 -8
  23. package/dist/commands/exec.js +3 -2
  24. package/dist/commands/feed.js +2 -31
  25. package/dist/commands/harness.js +3 -3
  26. package/dist/commands/hooks.js +1 -1
  27. package/dist/commands/import.js +1 -1
  28. package/dist/commands/insights.js +163 -85
  29. package/dist/commands/inspect.js +2 -2
  30. package/dist/commands/mine.js +1 -1
  31. package/dist/commands/monitors.js +1 -1
  32. package/dist/commands/org.d.ts +6 -0
  33. package/dist/commands/org.js +175 -0
  34. package/dist/commands/packages.js +1 -1
  35. package/dist/commands/profiles.js +2 -2
  36. package/dist/commands/prune.js +1 -1
  37. package/dist/commands/routines.js +44 -26
  38. package/dist/commands/run-account-picker.d.ts +19 -0
  39. package/dist/commands/run-account-picker.js +81 -0
  40. package/dist/commands/sessions-picker-factory.d.ts +40 -0
  41. package/dist/commands/sessions-picker-factory.js +67 -0
  42. package/dist/commands/sessions-picker.js +124 -122
  43. package/dist/commands/setup-browser.js +4 -4
  44. package/dist/commands/setup-mine.js +1 -1
  45. package/dist/commands/setup-preferences.js +2 -2
  46. package/dist/commands/setup.js +10 -4
  47. package/dist/commands/snapshot.d.ts +1 -1
  48. package/dist/commands/snapshot.js +4 -4
  49. package/dist/commands/status.d.ts +4 -2
  50. package/dist/commands/status.js +10 -7
  51. package/dist/commands/sync.d.ts +1 -0
  52. package/dist/commands/sync.js +30 -3
  53. package/dist/commands/versions.js +1 -1
  54. package/dist/commands/view.js +7 -1
  55. package/dist/commands/webhook.js +1 -1
  56. package/dist/lib/account-capabilities.d.ts +10 -0
  57. package/dist/lib/account-capabilities.js +34 -0
  58. package/dist/lib/accounting/rotate.d.ts +5 -3
  59. package/dist/lib/accounting/rotate.js +36 -7
  60. package/dist/lib/accounting/usage.d.ts +18 -4
  61. package/dist/lib/accounting/usage.js +138 -27
  62. package/dist/lib/agent-spec/agents.d.ts +584 -0
  63. package/dist/lib/agent-spec/agents.js +3127 -0
  64. package/dist/lib/agent-spec/provider.js +1 -1
  65. package/dist/lib/agents.d.ts +2 -584
  66. package/dist/lib/agents.js +2 -3127
  67. package/dist/lib/browser/drivers/local.d.ts +8 -2
  68. package/dist/lib/browser/drivers/local.js +8 -2
  69. package/dist/lib/browser/drivers/ssh.d.ts +8 -2
  70. package/dist/lib/browser/drivers/ssh.js +10 -4
  71. package/dist/lib/browser/hygiene.d.ts +1 -1
  72. package/dist/lib/browser/hygiene.js +5 -1
  73. package/dist/lib/browser/profiles.d.ts +74 -1
  74. package/dist/lib/browser/profiles.js +114 -5
  75. package/dist/lib/browser/runtime-state.d.ts +11 -5
  76. package/dist/lib/browser/runtime-state.js +13 -9
  77. package/dist/lib/browser/service.d.ts +68 -30
  78. package/dist/lib/browser/service.js +305 -194
  79. package/dist/lib/browser/types.d.ts +95 -3
  80. package/dist/lib/browser/types.js +51 -0
  81. package/dist/lib/catchup.js +1 -1
  82. package/dist/lib/cloud/rush.d.ts +0 -15
  83. package/dist/lib/cloud/rush.js +0 -35
  84. package/dist/lib/computer/actions.d.ts +1 -1
  85. package/dist/lib/computer/actions.js +1 -1
  86. package/dist/lib/{computer-rpc.js → computer/computer-rpc.js} +5 -5
  87. package/dist/lib/computer/dispatch.d.ts +1 -1
  88. package/dist/lib/computer/download.d.ts +1 -1
  89. package/dist/lib/computer/download.js +3 -3
  90. package/dist/lib/{ssh-tunnel.d.ts → computer/ssh-tunnel.d.ts} +1 -1
  91. package/dist/lib/{ssh-tunnel.js → computer/ssh-tunnel.js} +12 -12
  92. package/dist/lib/crabbox/runtimes.d.ts +6 -2
  93. package/dist/lib/crabbox/runtimes.js +21 -5
  94. package/dist/lib/daemon/daemon.js +87 -59
  95. package/dist/lib/{runner.d.ts → daemon/runner.d.ts} +28 -11
  96. package/dist/lib/{runner.js → daemon/runner.js} +143 -123
  97. package/dist/lib/devices/doctor-findings.d.ts +1 -1
  98. package/dist/lib/devices/doctor-findings.js +4 -4
  99. package/dist/lib/devices/fleet-inventory.js +1 -1
  100. package/dist/lib/devices/harness-inventory.js +1 -1
  101. package/dist/lib/devices/health-report.js +1 -1
  102. package/dist/lib/devices/registry.js +4 -22
  103. package/dist/lib/doctor-diff.d.ts +1 -1
  104. package/dist/lib/doctor-diff.js +1 -1
  105. package/dist/lib/drift-sync.d.ts +1 -1
  106. package/dist/lib/drift-sync.js +2 -2
  107. package/dist/lib/drift.d.ts +1 -1
  108. package/dist/lib/drift.js +1 -1
  109. package/dist/lib/entitlement.d.ts +31 -0
  110. package/dist/lib/entitlement.js +137 -0
  111. package/dist/lib/exec.js +52 -205
  112. package/dist/lib/feed/feed.js +2 -8
  113. package/dist/lib/format.d.ts +9 -0
  114. package/dist/lib/format.js +16 -0
  115. package/dist/lib/fs-atomic.d.ts +7 -0
  116. package/dist/lib/fs-atomic.js +9 -0
  117. package/dist/lib/github/pr-mergeable.d.ts +49 -0
  118. package/dist/lib/github/pr-mergeable.js +157 -0
  119. package/dist/lib/github/pr-verdict.d.ts +67 -0
  120. package/dist/lib/github/pr-verdict.js +72 -0
  121. package/dist/lib/harness/adapter.d.ts +161 -0
  122. package/dist/lib/harness/adapter.js +47 -0
  123. package/dist/lib/harness/adapters/claude.d.ts +2 -0
  124. package/dist/lib/harness/adapters/claude.js +110 -0
  125. package/dist/lib/harness/adapters/codex.d.ts +2 -0
  126. package/dist/lib/harness/adapters/codex.js +83 -0
  127. package/dist/lib/harness/adapters/copilot.d.ts +2 -0
  128. package/dist/lib/harness/adapters/copilot.js +23 -0
  129. package/dist/lib/harness/adapters/cursor.d.ts +2 -0
  130. package/dist/lib/harness/adapters/cursor.js +38 -0
  131. package/dist/lib/harness/adapters/droid.d.ts +2 -0
  132. package/dist/lib/harness/adapters/droid.js +17 -0
  133. package/dist/lib/harness/adapters/grok.d.ts +2 -0
  134. package/dist/lib/harness/adapters/grok.js +14 -0
  135. package/dist/lib/harness/adapters/kimi.d.ts +2 -0
  136. package/dist/lib/harness/adapters/kimi.js +49 -0
  137. package/dist/lib/harness/adapters/muse.d.ts +2 -0
  138. package/dist/lib/harness/adapters/muse.js +44 -0
  139. package/dist/lib/harness/adapters/opencode.d.ts +2 -0
  140. package/dist/lib/harness/adapters/opencode.js +14 -0
  141. package/dist/lib/harness/exec-config-version.d.ts +8 -0
  142. package/dist/lib/harness/exec-config-version.js +22 -0
  143. package/dist/lib/harness/index.d.ts +1 -0
  144. package/dist/lib/harness/index.js +34 -0
  145. package/dist/lib/{hooks.d.ts → hooks/install.d.ts} +1 -1
  146. package/dist/lib/{hooks.js → hooks/install.js} +11 -11
  147. package/dist/lib/hosts/passthrough.d.ts +10 -0
  148. package/dist/lib/hosts/passthrough.js +28 -6
  149. package/dist/lib/hosts/session-index.js +1 -1
  150. package/dist/lib/import.js +1 -1
  151. package/dist/lib/installations/index.d.ts +4 -4
  152. package/dist/lib/installations/index.js +3 -4
  153. package/dist/lib/installations/migrate.js +6 -6
  154. package/dist/lib/{shims.d.ts → installations/shims.d.ts} +2 -2
  155. package/dist/lib/{shims.js → installations/shims.js} +13 -115
  156. package/dist/lib/installations/store.d.ts +141 -3
  157. package/dist/lib/installations/store.js +475 -5
  158. package/dist/lib/installations/versions.d.ts +40 -125
  159. package/dist/lib/installations/versions.js +57 -462
  160. package/dist/lib/isolation-boundary-report.d.ts +1 -1
  161. package/dist/lib/isolation-boundary-report.js +1 -1
  162. package/dist/lib/mailbox-gc.js +2 -3
  163. package/dist/lib/menubar/MenubarHelper.app/Contents/CodeResources +0 -0
  164. package/dist/lib/menubar/MenubarHelper.app/Contents/MacOS/MenubarHelper +0 -0
  165. package/dist/lib/menubar/install-menubar.js +19 -8
  166. package/dist/lib/monitors/config.d.ts +2 -2
  167. package/dist/lib/monitors/config.js +3 -2
  168. package/dist/lib/monitors/dispatch.d.ts +1 -1
  169. package/dist/lib/monitors/dispatch.js +2 -2
  170. package/dist/lib/monitors/state.d.ts +1 -1
  171. package/dist/lib/origin-machine.d.ts +18 -0
  172. package/dist/lib/origin-machine.js +34 -0
  173. package/dist/lib/perf/db.js +1 -1
  174. package/dist/lib/perf/spool.js +1 -1
  175. package/dist/lib/plugins/plugins.js +1 -1
  176. package/dist/lib/plugins/skills.js +1 -1
  177. package/dist/lib/prix-account.d.ts +158 -0
  178. package/dist/lib/prix-account.js +214 -0
  179. package/dist/lib/profiles.d.ts +7 -0
  180. package/dist/lib/profiles.js +26 -1
  181. package/dist/lib/project-key.js +2 -2
  182. package/dist/lib/project-launch.js +1 -1
  183. package/dist/lib/refresh.js +2 -2
  184. package/dist/lib/resource-inventory.d.ts +1 -1
  185. package/dist/lib/resource-inventory.js +1 -1
  186. package/dist/lib/rules/rules.js +1 -1
  187. package/dist/lib/sandbox.d.ts +24 -0
  188. package/dist/lib/sandbox.js +101 -0
  189. package/dist/lib/scheduling/routines.d.ts +18 -9
  190. package/dist/lib/scheduling/routines.js +17 -9
  191. package/dist/lib/secrets/Agents CLI.app/Contents/CodeResources +0 -0
  192. package/dist/lib/secrets/Agents CLI.app/Contents/MacOS/Agents CLI +0 -0
  193. package/dist/lib/secrets/agent.js +9 -1
  194. package/dist/lib/secrets/index.js +1 -1
  195. package/dist/lib/secrets/list-filter.js +1 -1
  196. package/dist/lib/self-heal/checks/hook-runtime.js +1 -1
  197. package/dist/lib/self-heal/checks/path.js +1 -1
  198. package/dist/lib/self-heal/checks/shadowing.js +1 -1
  199. package/dist/lib/self-heal/checks/shims.js +1 -1
  200. package/dist/lib/service-manifest.d.ts +20 -0
  201. package/dist/lib/service-manifest.js +34 -0
  202. package/dist/lib/session/cloud.js +1 -1
  203. package/dist/lib/session/db.js +1 -1
  204. package/dist/lib/session/discover.d.ts +39 -0
  205. package/dist/lib/session/discover.js +3 -3
  206. package/dist/lib/session/fork.js +1 -1
  207. package/dist/lib/session/live-metadata.js +1 -1
  208. package/dist/lib/session/origin-machine.d.ts +1 -18
  209. package/dist/lib/session/origin-machine.js +4 -34
  210. package/dist/lib/session/parse.js +24 -42
  211. package/dist/lib/session/recovery.js +1 -1
  212. package/dist/lib/session/relative-time.d.ts +1 -44
  213. package/dist/lib/session/relative-time.js +4 -120
  214. package/dist/lib/session/remote-list.js +1 -1
  215. package/dist/lib/session/remote.js +2 -2
  216. package/dist/lib/session/short-id.d.ts +1 -17
  217. package/dist/lib/session/short-id.js +4 -20
  218. package/dist/lib/session/width.d.ts +1 -29
  219. package/dist/lib/session/width.js +4 -101
  220. package/dist/lib/snapshot.d.ts +2 -2
  221. package/dist/lib/snapshot.js +1 -1
  222. package/dist/lib/staleness/prune.d.ts +1 -1
  223. package/dist/lib/staleness/prune.js +1 -1
  224. package/dist/lib/staleness/writers/hooks.js +1 -1
  225. package/dist/lib/startup/command-registry.d.ts +4 -1
  226. package/dist/lib/startup/command-registry.js +12 -5
  227. package/dist/lib/teams/agents.js +2 -19
  228. package/dist/lib/teams/parsers.js +20 -26
  229. package/dist/lib/teams/placement-probe.js +1 -1
  230. package/dist/lib/teams/registry.js +2 -21
  231. package/dist/lib/teams/scheduler.js +1 -1
  232. package/dist/lib/text/relative-time.d.ts +44 -0
  233. package/dist/lib/text/relative-time.js +120 -0
  234. package/dist/lib/text/short-id.d.ts +17 -0
  235. package/dist/lib/text/short-id.js +20 -0
  236. package/dist/lib/text/width.d.ts +29 -0
  237. package/dist/lib/text/width.js +101 -0
  238. package/dist/lib/triggers/handlers.d.ts +7 -0
  239. package/dist/lib/triggers/handlers.js +9 -1
  240. package/dist/lib/triggers/webhook.d.ts +1 -0
  241. package/dist/lib/triggers/webhook.js +3 -2
  242. package/dist/lib/uninstall.js +1 -1
  243. package/dist/lib/version.d.ts +9 -2
  244. package/dist/lib/version.js +11 -9
  245. package/dist/lib/view-types.d.ts +4 -0
  246. package/package.json +1 -1
  247. package/dist/commands/tickets.d.ts +0 -2
  248. package/dist/commands/tickets.js +0 -43
  249. package/dist/lib/observe-aliases.d.ts +0 -30
  250. package/dist/lib/observe-aliases.js +0 -38
  251. package/dist/lib/tickets/list.d.ts +0 -53
  252. package/dist/lib/tickets/list.js +0 -153
  253. /package/dist/lib/{computer-rpc.d.ts → computer/computer-rpc.d.ts} +0 -0
@@ -1,5 +1,6 @@
1
1
  import type { AgentId } from '../types.js';
2
2
  import { compareVersions } from '../agent-spec/primitives.js';
3
+ export * from './store.js';
3
4
  import { type PrunableKind } from '../staleness/prune.js';
4
5
  /**
5
6
  * Resource selection for syncing to a version.
@@ -107,82 +108,6 @@ export interface AgentSpec {
107
108
  * "codex@latest" -> { agent: "codex", version: "latest" }
108
109
  */
109
110
  export declare function parseAgentSpec(spec: string): AgentSpec | null;
110
- /**
111
- * Get the directory where a specific version is installed.
112
- */
113
- export declare function getVersionDir(agent: AgentId, version: string): string;
114
- /**
115
- * Pick the real grok binary among `grok-*` entries in `downloadsDir` when NO
116
- * filename carries the pinned version string. Grok self-updates its binary in
117
- * place while running under the shim, so a version-home's downloads dir can
118
- * accumulate several `grok-*` files whose names have drifted away from that
119
- * version-home's pinned version (RUSH-2459: on yosemite-s0, version-home
120
- * `0.2.82` held `grok-1.0.0-linux-aarch64` after grok self-updated, plus a
121
- * stale, unrelated 99-byte `grok-0.2.118-linux-aarch64` wrapper script that
122
- * happened to sort alphabetically first).
123
- *
124
- * Never blindly take whatever `fs.readdirSync` returns first — that is exactly
125
- * the bug this replaces. Instead: exclude anything under
126
- * {@link MIN_GROK_BINARY_BYTES} (rejects wrapper/alias artifacts on size
127
- * alone, no content sniffing needed) and, among the survivors, prefer the most
128
- * recently modified — the file grok's self-updater actually wrote last.
129
- * Returns null (fail loud, never guess) when nothing survives the size filter.
130
- */
131
- export declare function resolveGrokFallbackBinary(downloadsDir: string): string | null;
132
- /**
133
- * Get the binary path for a specific agent version.
134
- */
135
- export declare function getBinaryPath(agent: AgentId, version: string): string;
136
- /**
137
- * Does this agent resolve to ONE global binary that is the same file regardless
138
- * of the `version` argument? (droid → always `~/.local/bin/droid`.) Computed
139
- * generically by probing `getBinaryPath` with two distinct versions rather than
140
- * hardcoding an agent id, so it stays correct if another global-binary agent is
141
- * added.
142
- *
143
- * This is the narrower cousin of `isSelfUpdatingAgent`: every global-binary
144
- * agent is self-updating, but grok is self-updating WITHOUT a global binary — it
145
- * stores a real per-version binary copy under each version-home
146
- * (`versions/grok/<v>/home/.grok/downloads/grok-<v>`), so its version-homes are
147
- * genuinely distinct and must NOT be collapsed. Gate the single-binary
148
- * collapse/live-version logic on THIS predicate; gate pin-refusal / "switch
149
- * profile" copy on `isSelfUpdatingAgent`.
150
- */
151
- export declare function isGlobalBinaryAgent(agent: AgentId): boolean;
152
- /** Drop the live-version cache (call after an install/remove that changes the
153
- * running binary, e.g. `agents add droid@latest`). */
154
- export declare function invalidateLiveVersionCache(agent?: AgentId): void;
155
- /**
156
- * Resolve the version the ONE globally-installed binary actually reports via
157
- * `<cli> --version`, cached for {@link LIVE_VERSION_TTL_MS}. For a self-updating
158
- * global-binary agent (droid) this is the single source of truth for "which
159
- * version is installed" — the on-disk version-dir NAMES are just stale labels
160
- * left behind by successive `agents add`/self-update cycles. Returns null when
161
- * the binary isn't on PATH or the probe fails.
162
- */
163
- export declare function getLiveVersion(agent: AgentId): Promise<string | null>;
164
- /**
165
- * Synchronous, non-blocking read of the live-version cache — returns the value
166
- * only if a recent {@link getLiveVersion} call already warmed it, else null.
167
- * `listInstalledVersions` is sync and must not shell out, so it prefers this
168
- * warm value (accurate) and otherwise falls back to the newest on-disk dir.
169
- */
170
- export declare function getCachedLiveVersion(agent: AgentId): string | null;
171
- /**
172
- * Get the isolated HOME directory for a specific agent version.
173
- * Each version has its own config isolation (like jobs sandbox).
174
- */
175
- export declare function getVersionHomePath(agent: AgentId, version: string): string;
176
- /**
177
- * Check if a specific version is installed.
178
- *
179
- * Probes the actual launch binary (the same executable the shims run), not just
180
- * the version dir or the node_modules/.bin/<cli> wrapper. For npm agents that
181
- * means statting the package's real `bin` target (getPackageBinaryPath), so a
182
- * present-but-gutted install (vendor auto-updater destroyed the binary) reports
183
- * as NOT installed and `agents add` re-runs its install step to repair it.
184
- */
185
- export declare function isVersionInstalled(agent: AgentId, version: string): boolean;
186
111
  /**
187
112
  * Get the latest available version from npm for an agent.
188
113
  */
@@ -205,16 +130,6 @@ export declare function isOldestInstalled(agent: AgentId): Promise<{
205
130
  installed: boolean;
206
131
  version: string | null;
207
132
  }>;
208
- /** Drop the installed-versions cache (call after install/remove mutations). */
209
- export declare function invalidateInstalledVersionsCache(agent?: AgentId): void;
210
- /**
211
- * List all installed versions for an agent (cached by versions-dir mtime).
212
- *
213
- * For a self-updating global-binary agent (droid) every version dir resolves to
214
- * the SAME binary, so this collapses them to a single canonical entry — one
215
- * install, one row in `agents view`, never the phantom set of semver dir names.
216
- */
217
- export declare function listInstalledVersions(agent: AgentId): string[];
218
133
  /**
219
134
  * List every version directory for an agent, including ones missing the
220
135
  * binary (typically home-only leftovers from a prior `removeVersion`).
@@ -227,19 +142,10 @@ export declare function listInstalledVersionDirs(agent: AgentId): Array<{
227
142
  version: string;
228
143
  hasBinary: boolean;
229
144
  }>;
230
- /**
231
- * Get the global default version for an agent.
232
- */
233
- export declare function getGlobalDefault(agent: AgentId): string | null;
234
145
  /**
235
146
  * Set the global default version for an agent.
236
147
  */
237
148
  export declare function setGlobalDefault(agent: AgentId, version: string | undefined): void;
238
- /**
239
- * Get the preferred ISOLATED version for an agent — the copy a bare
240
- * `agents run <agent>` falls back to when there is no global default.
241
- */
242
- export declare function getIsolatedDefault(agent: AgentId): string | null;
243
149
  /**
244
150
  * Set (or clear, with `undefined`) the preferred isolated version.
245
151
  *
@@ -248,22 +154,6 @@ export declare function getIsolatedDefault(agent: AgentId): string | null;
248
154
  * a pointer inside the sandbox, so it stays inside the sandbox.
249
155
  */
250
156
  export declare function setIsolatedDefault(agent: AgentId, version: string | undefined): void;
251
- /**
252
- * Mark an installed version as an isolated install (`agents add --isolated`).
253
- *
254
- * Isolated versions are fully self-contained: they never become the global
255
- * default and never own the user's real `~/.<agent>` config directory. This
256
- * flag is what keeps every "adopting" code path away from them.
257
- */
258
- export declare function markVersionIsolated(agent: AgentId, version: string): void;
259
- /**
260
- * Whether a version was installed as an isolated install (`agents add --isolated`).
261
- *
262
- * Used to exclude such versions from global-default promotion and from any
263
- * flow that would touch the user's real `~/.<agent>` directory, and to gate the
264
- * `--isolated` safety check on `agents remove`.
265
- */
266
- export declare function isVersionIsolated(agent: AgentId, version: string): boolean;
267
157
  /**
268
158
  * Install a specific version of an agent.
269
159
  */
@@ -340,11 +230,46 @@ export declare function printTrashFooter(moved: Array<{
340
230
  * containing only `home/`) remain under the agent dir.
341
231
  */
342
232
  export declare function removeAllVersions(agent: AgentId): number;
233
+ export interface HealedVersionPointers {
234
+ /** Global default reassigned off a not-installed version (`to: null` = cleared). */
235
+ globalDefault?: {
236
+ from: string;
237
+ to: string | null;
238
+ };
239
+ /** Isolated default (bare `agents run <agent>`) reassigned off a not-installed version. */
240
+ isolatedDefault?: {
241
+ from: string;
242
+ to: string | null;
243
+ };
244
+ /** `~/.<agent>` config symlink repointed off a not-installed version. */
245
+ configSymlink?: {
246
+ from: string;
247
+ to: string;
248
+ };
249
+ }
343
250
  /**
344
- * Get the resolved version for an agent in the current context.
345
- * Checks project manifest first, then global default.
346
- */
347
- export declare function resolveVersion(agent: AgentId, projectPath?: string): string | null;
251
+ * Repoint an agent's version pointers the global/isolated default and the
252
+ * `~/.<agent>` config symlink off any version that is no longer installed, so
253
+ * neither `agents sync`/`agents run` resolution nor the conventional-path home
254
+ * can land on a dead version (RUSH-2471).
255
+ *
256
+ * How a pointer goes dangling: {@link removeVersion} reassigns the defaults and
257
+ * clears the config symlink only when IT removes the pointed-at version. A
258
+ * version-home whose launch binary disappears by any other route — grok
259
+ * self-updated its per-version binary out from under the old dir, a manual
260
+ * delete, a half-finished install that seeded the home but never landed the
261
+ * binary — leaves the default and/or the symlink pointing at something
262
+ * {@link isVersionInstalled} reports as gone.
263
+ *
264
+ * Called from the sync resolve path so the invariant self-heals. Mirrors
265
+ * {@link removeVersion}'s reassignment: the global default prefers the newest
266
+ * NON-isolated survivor else clears; the isolated default prefers the newest
267
+ * remaining isolated copy else clears. The symlink is repointed at the now-healed
268
+ * resolved default, else the newest installed non-isolated version. A symlink
269
+ * already on an installed version, a real (non-symlink) config dir, and an
270
+ * isolated-only agent are left untouched.
271
+ */
272
+ export declare function healDanglingVersionPointers(agent: AgentId, cwd: string): Promise<HealedVersionPointers>;
348
273
  /**
349
274
  * Normalize a user-supplied @version token across CLI subcommands.
350
275
  *
@@ -371,10 +296,6 @@ export declare function resolveVersionAlias(agent: AgentId, raw: string | undefi
371
296
  * remain queryable.
372
297
  */
373
298
  export declare function resolveVersionAliasLoose(agent: AgentId, raw: string | undefined | null): string | undefined;
374
- /**
375
- * Get version specified in a project-root agents.yaml (not the user ~/.agents/.system/agents.yaml).
376
- */
377
- export declare function getProjectVersion(agent: AgentId, startPath: string): string | null;
378
299
  export { compareVersions };
379
300
  /**
380
301
  * Get actual version from an installed 'latest' directory.
@@ -603,12 +524,6 @@ export declare function syncResourcesToVersion(agent: AgentId, version: string,
603
524
  prune?: boolean;
604
525
  allowExecSurfaces?: boolean;
605
526
  }): SyncResult;
606
- /**
607
- * Get the effective HOME directory for an agent.
608
- * If version-managed with a resolved version, returns the version's home directory.
609
- * Otherwise returns the real HOME.
610
- */
611
- export declare function getEffectiveHome(agentId: AgentId): string;
612
527
  /** Result of resolving agent/version targets from CLI input or interactive selection. */
613
528
  export interface VersionSelectionResult {
614
529
  selectedAgents: AgentId[];