@meistrari/tela-cli 1.9.0 → 1.9.2

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/README.md CHANGED
@@ -40,7 +40,11 @@ tela agent feedback --list --apply <all|select> --json --verbose
40
40
 
41
41
  `auth login` uses device flow and creates or updates a context backed by the
42
42
  same Keychain credential adapter as Dock. `auth token` may refresh that session
43
- before returning metadata or printing a raw token.
43
+ before returning metadata or printing a raw token. On macOS, renewing a Keychain
44
+ session is delegated to Tela Dock, so sandboxed agents only read the saved
45
+ credential. The CLI opens the installed Dock in the background if needed;
46
+ update both Dock and the CLI to use this flow. A valid access token can still be
47
+ read without Dock. `TELA_HOME` must refer to the same configuration as Dock.
44
48
 
45
49
  The top-level `api`, `docs`, `update`, `whoami`, and `token` aliases on `tela`
46
50
  remain available during migration. Service catalog and per-service environment
@@ -85,7 +89,10 @@ The CLI uses the credential adapter contract from `local-config`.
85
89
  - expired user-session access tokens with a refresh token are reported as
86
90
  `refreshable`, not as a hard auth failure.
87
91
  - `auth token` refreshes expired user-session access tokens when a refresh token
88
- is available.
92
+ is available. For macOS Keychain sessions, Dock performs both the exchange
93
+ and persistence. If Dock is unavailable or too old, the command fails before
94
+ trying a direct refresh in the CLI; it never silently falls back to the
95
+ sandbox write that could consume and lose a rotating refresh token.
89
96
  - unsupported providers report diagnostic status instead of exposing secrets.
90
97
 
91
98
  `auth token --raw` is the explicit token-export escape hatch for shell scripts.
@@ -115,3 +122,18 @@ node scripts/install-skills.cjs --quiet
115
122
 
116
123
  The published package does not require `tsx`, TypeScript, or esbuild at
117
124
  postinstall time.
125
+
126
+ ### Native macOS renewal regression
127
+
128
+ After `corepack pnpm cli:build`, run:
129
+
130
+ ```bash
131
+ corepack pnpm exec tsx scripts/verify-session-renewal-macos.ts
132
+ ```
133
+
134
+ This uses a disposable Keychain item and a local auth fixture. It reproduces
135
+ `Operation not permitted` with `sandbox-exec`, proves the old path consumed a
136
+ refresh token before failing to save, then runs the compiled CLI under the same
137
+ restriction against Dock's broker implementation. It verifies persistence in
138
+ real Keychain, another expired session, and three concurrent CLI processes. The
139
+ fixture deletes its Keychain item and temporary config afterward.
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.runAuthCommand = runAuthCommand;
7
7
  exports.formatDeviceFlowInstructions = formatDeviceFlowInstructions;
8
+ const refresh_session_1 = require("../refresh-session");
8
9
  const node_child_process_1 = require("node:child_process");
9
10
  const promises_1 = require("node:fs/promises");
10
11
  const node_os_1 = require("node:os");
@@ -295,7 +296,7 @@ async function resolveToken(options) {
295
296
  throw new Error(`Missing credential for Tela context ${resolved.id}`);
296
297
  }
297
298
  const credential = originalCredential.kind === 'user-session'
298
- ? await (0, tela_local_config_1.refreshUserSessionCredential)(resolved.environment, credentialRef, originalCredential, credentials)
299
+ ? await (0, refresh_session_1.refreshCliSession)(resolved, originalCredential, credentials)
299
300
  : originalCredential;
300
301
  const refreshed = credential !== originalCredential;
301
302
  if (options.kind === 'access-token') {