@phnx-labs/agents-cli 1.22.91 → 1.22.92

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.22.92
4
+
5
+ - **AGI Menu 1.1.0 is the helper the CLI installs (PHNX-4007).** The menu-bar
6
+ helper floor moves from 1.0.0 to 1.1.0, so `agents menubar setup` and
7
+ `agents menubar enable` download and install the release that carries the
8
+ dispatch form, the Sessions window, actionable notification banners, the
9
+ screenshot OCR index, and the FeedStream data layer (PHNX-3999). The startup
10
+ self-heal stays network-free: it reinstalls only from a bundled or cached copy,
11
+ so an existing 1.0.0 install upgrades on the next `agents menubar setup`.
12
+ Source: `src/lib/helper-versions.ts`.
13
+
3
14
  ## 1.22.91
4
15
 
5
16
  - **`agents sessions` search/list execs the standalone `sessions` CLI (PHNX-4012).** Read queries intercept in `index.ts` before bootstrap so they skip the 6K-line in-process engine. Lifecycle verbs (`resume`, `stop`, `inject`, `watch`, `--active`, `--markdown`) still load the in-repo command. The `sessions` alias shim is retired like `secrets` so it cannot recurse. Install: `npm i -g @phnx-labs/sessions-cli`. Source: `cli/src/index.ts`, `cli/src/lib/sessions-client.ts`, `cli/scripts/postinstall.js`.
@@ -2234,7 +2234,7 @@ agents run auto --device yosemite-s0 "fix the flaky test" # pin the device
2234
2234
  // dispatch time; the peer resolves ITS slot. This block is local-only.
2235
2235
  const remoteTarget = options.host || options.device;
2236
2236
  if (!remoteTarget) {
2237
- const { adoptedConfigPointsAtHome, adoptedSymlinkMismatchError, isSymlinkAdoptedHarness, resolveNativeSpawnHome, symlinkAdoptedAccountError, } = await import('../lib/exec-account-home.js');
2237
+ const { adoptedConfigPointsAtHome, adoptedSymlinkMismatchError, durableSlotEnv, isSymlinkAdoptedHarness, resolveNativeSpawnHome, symlinkAdoptedAccountError, } = await import('../lib/exec-account-home.js');
2238
2238
  const { readMeta } = await import('../lib/state.js');
2239
2239
  const meta = readMeta();
2240
2240
  if (isSymlinkAdoptedHarness(agent)) {
@@ -2251,6 +2251,11 @@ agents run auto --device yosemite-s0 "fix the flaky test" # pin the device
2251
2251
  process.exit(1);
2252
2252
  }
2253
2253
  execHome = resolved.execHome;
2254
+ // A worker's durable api-key slot holds no file: the pushed key
2255
+ // rides the harness env var (CURSOR_API_KEY, …) on this launch.
2256
+ const durable = durableSlotEnv(agent, spawnAccount, resolved, meta);
2257
+ if (Object.keys(durable).length > 0)
2258
+ accountEnv = { ...accountEnv, ...durable };
2254
2259
  if (resolved.source === 'legacy-home') {
2255
2260
  accountConfigVersion = resolved.label;
2256
2261
  // A leftover version-labeled home is both the spawn HOME and
@@ -1,3 +1,4 @@
1
+ import { selfConfiguredDeviceRole } from './device-config.js';
1
2
  import { isSymlinkAdoptedHarness } from './installations/shims.js';
2
3
  import type { AgentId, DeviceAccountSlot, Meta } from './types.js';
3
4
  export { isAccountSlotDir } from './agents.js';
@@ -10,6 +11,24 @@ export interface NativeSpawnHome {
10
11
  /** Installation label when `source` is `legacy-home`. */
11
12
  label?: string;
12
13
  }
14
+ /**
15
+ * The env a DURABLE slot injects at spawn (PHNX-3940 T5/T6). A worker's slot
16
+ * for an api-key harness (codex/grok/cursor/opencode/droid) holds no file — the
17
+ * daemon pushed the account's worker API key into the reserved
18
+ * `__<harness>__` store and `provisionWorkerSlot` recorded the slot as
19
+ * `durable`; the key rides the harness's own env var (`CURSOR_API_KEY`, …)
20
+ * on every launch. Anything else — a native login in the slot on a headed
21
+ * device, a claude durable slot (its setup-token is a `.oauth_token` file the
22
+ * adapter reads), a harness with no api-key worker kind, a headed device — injects
23
+ * nothing.
24
+ * Without this, `agents run cursor#gmail` on a worker reached Cursor with an
25
+ * empty env and got `Authentication required … set CURSOR_API_KEY`.
26
+ */
27
+ export declare function durableSlotEnv(agent: AgentId, account: {
28
+ id: string;
29
+ }, resolved: Pick<NativeSpawnHome, 'slot'>, meta: Pick<Meta, 'accounts' | 'deviceAccounts'>, deps?: {
30
+ selfRole?: () => ReturnType<typeof selfConfiguredDeviceRole>;
31
+ }): Record<string, string>;
13
32
  export declare function missingSlotHint(agent: AgentId, name: string): string;
14
33
  export declare function symlinkAdoptedAccountError(agent: AgentId, name: string, defaultName: string | undefined): string;
15
34
  export declare function adoptedSymlinkMismatchError(agent: AgentId, name: string, execHome: string): string;
@@ -13,7 +13,7 @@ import * as os from 'node:os';
13
13
  import * as path from 'node:path';
14
14
  import { listNativeAccounts, nativeAccountHome } from './account-registry.js';
15
15
  import { readSlots } from './accounts/slots.js';
16
- import { workerProvisioningHint } from './accounts/add.js';
16
+ import { workerProvisioningHint, workerApiKeyEnv } from './accounts/add.js';
17
17
  import { AGENTS, credentialPresence, getAccountInfo } from './agents.js';
18
18
  import { AUTH_BUNDLE, claudeAccountTokenKey, provisionWorkerSlot, readReservedCredential } from './claude-account-token.js';
19
19
  import { isHeadedDeviceRole, selfConfiguredDeviceRole } from './device-config.js';
@@ -22,6 +22,40 @@ import { getAgentConfigPath, isSymlinkAdoptedHarness, repointAdoptedConfigToHome
22
22
  import { getVersionHomePath, listInstalledVersions } from './installations/versions.js';
23
23
  export { isAccountSlotDir } from './agents.js';
24
24
  export { isSymlinkAdoptedHarness };
25
+ /**
26
+ * The env a DURABLE slot injects at spawn (PHNX-3940 T5/T6). A worker's slot
27
+ * for an api-key harness (codex/grok/cursor/opencode/droid) holds no file — the
28
+ * daemon pushed the account's worker API key into the reserved
29
+ * `__<harness>__` store and `provisionWorkerSlot` recorded the slot as
30
+ * `durable`; the key rides the harness's own env var (`CURSOR_API_KEY`, …)
31
+ * on every launch. Anything else — a native login in the slot on a headed
32
+ * device, a claude durable slot (its setup-token is a `.oauth_token` file the
33
+ * adapter reads), a harness with no api-key worker kind, a headed device — injects
34
+ * nothing.
35
+ * Without this, `agents run cursor#gmail` on a worker reached Cursor with an
36
+ * empty env and got `Authentication required … set CURSOR_API_KEY`.
37
+ */
38
+ export function durableSlotEnv(agent, account, resolved, meta, deps = {}) {
39
+ if (resolved.slot?.authMode !== 'durable')
40
+ return {};
41
+ // A headed device authenticates from its own native login (invariant 7). A
42
+ // `durable` record can outlive a role change (`agents devices role … personal`
43
+ // never rewrites slots), so the gate is the box's CURRENT role, the same
44
+ // predicate `isProvisionableWorker` applies — never a record on disk.
45
+ if (isHeadedDeviceRole((deps.selfRole ?? selfConfiguredDeviceRole)()))
46
+ return {};
47
+ const envName = workerApiKeyEnv(agent);
48
+ if (!envName)
49
+ return {};
50
+ const row = nativeRow(account.id, meta);
51
+ const cred = row?.workerCredential;
52
+ if (!cred || cred.kind !== 'api-key')
53
+ return {};
54
+ const value = readReservedCredential(cred.bundle, cred.key);
55
+ if (!value)
56
+ return {};
57
+ return { [envName]: value };
58
+ }
25
59
  export function missingSlotHint(agent, name) {
26
60
  const role = selfConfiguredDeviceRole();
27
61
  if (!isHeadedDeviceRole(role)) {
@@ -36,7 +36,7 @@
36
36
  * helper release now, off this table entirely.
37
37
  */
38
38
  export const HELPER_RELEASES = {
39
- menubar: { tagPrefix: 'menubar', floor: '1.0.0' },
39
+ menubar: { tagPrefix: 'menubar', floor: '1.1.0' },
40
40
  'computer-mac': { tagPrefix: 'computer-mac', floor: '1.0.0' },
41
41
  // The Windows helper is a bare .exe, not an .app bundle, so it does not share
42
42
  // helper-download.ts's zip/codesign/notarize machinery -- but it has the same
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.22.91",
3
+ "version": "1.22.92",
4
4
  "description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",