@odla-ai/cli 0.11.0 → 0.11.1
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 +5 -4
- package/dist/bin.cjs +15 -12
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-KUQCJ6KA.js → chunk-DC4MIB4X.js} +16 -13
- package/dist/chunk-DC4MIB4X.js.map +1 -0
- package/dist/index.cjs +15 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -8
- package/dist/index.d.ts +5 -8
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KUQCJ6KA.js.map +0 -1
package/README.md
CHANGED
|
@@ -110,10 +110,11 @@ shown-once credential.
|
|
|
110
110
|
`--email <account>` or `ODLA_USER_EMAIL`; the matching existing account must
|
|
111
111
|
sign in, review the exact code, and approve it. Opening the URL alone does
|
|
112
112
|
not claim the request.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
When the code is displayed it opens the approval page in your browser —
|
|
114
|
+
including from scripted and agent-driven shells; only CI, SSH sessions, and
|
|
115
|
+
display-less hosts skip the launch. Pass `--open` to force it anyway, or
|
|
116
|
+
`--no-open` to suppress it. Browser launch is best-effort; the printed URL
|
|
117
|
+
and code always remain the fallback.
|
|
117
118
|
2. Creates the platform app if needed.
|
|
118
119
|
3. Enables configured services in every configured environment. Calendar
|
|
119
120
|
config is normalized per env and fixed to Google read-only access.
|
package/dist/bin.cjs
CHANGED
|
@@ -237,12 +237,16 @@ function handshakeEmail(value, cached) {
|
|
|
237
237
|
}
|
|
238
238
|
return email;
|
|
239
239
|
}
|
|
240
|
-
function approvalBrowser(options) {
|
|
240
|
+
function approvalBrowser(options, host = {}) {
|
|
241
241
|
if (options.open === true) return { open: true, mode: "forced" };
|
|
242
242
|
if (options.open === false) return { open: false, reason: "disabled by --no-open" };
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (
|
|
243
|
+
const env = host.env ?? import_node_process2.default.env;
|
|
244
|
+
if (env.CI) return { open: false, reason: "CI environment" };
|
|
245
|
+
if (env.SSH_CONNECTION || env.SSH_TTY) return { open: false, reason: "SSH session; pass --open to force" };
|
|
246
|
+
const platform = host.platform ?? import_node_process2.default.platform;
|
|
247
|
+
if (platform !== "darwin" && platform !== "win32" && !env.DISPLAY && !env.WAYLAND_DISPLAY) {
|
|
248
|
+
return { open: false, reason: "no graphical display; pass --open to force" };
|
|
249
|
+
}
|
|
246
250
|
return { open: true, mode: "auto" };
|
|
247
251
|
}
|
|
248
252
|
function handshakeUrl(platformUrl, userCode) {
|
|
@@ -339,8 +343,9 @@ async function scopedToken(platform, scope, options, doFetch, out) {
|
|
|
339
343
|
onCode: async ({ userCode, expiresIn, verificationUriComplete }) => {
|
|
340
344
|
const approvalUrl = verificationUriComplete ?? handshakeUrl(audience, userCode);
|
|
341
345
|
out.log(`Review, then approve scoped request ${userCode} at ${approvalUrl} within ${Math.floor(expiresIn / 60)}m.`);
|
|
342
|
-
|
|
343
|
-
|
|
346
|
+
if (approvalBrowser({ open: options.open }).open) {
|
|
347
|
+
await (options.openApprovalUrl ?? openUrl)(approvalUrl).catch(() => void 0);
|
|
348
|
+
}
|
|
344
349
|
}
|
|
345
350
|
});
|
|
346
351
|
const tokens = cache?.platform === audience ? { ...cache.tokens ?? {} } : {};
|
|
@@ -1412,7 +1417,6 @@ async function lifecycleContext(options) {
|
|
|
1412
1417
|
token: options.token,
|
|
1413
1418
|
email: options.email,
|
|
1414
1419
|
open: options.open,
|
|
1415
|
-
interactive: options.interactive,
|
|
1416
1420
|
openApprovalUrl: options.openConsentUrl
|
|
1417
1421
|
},
|
|
1418
1422
|
doFetch,
|
|
@@ -1421,7 +1425,7 @@ async function lifecycleContext(options) {
|
|
|
1421
1425
|
return { cfg, ctx: { platform: cfg.platformUrl, appId: cfg.app.id, env, token, fetch: doFetch }, out };
|
|
1422
1426
|
}
|
|
1423
1427
|
function connectionOptions(options, out) {
|
|
1424
|
-
const browser = approvalBrowser({
|
|
1428
|
+
const browser = approvalBrowser({ open: options.open });
|
|
1425
1429
|
return {
|
|
1426
1430
|
out,
|
|
1427
1431
|
open: browser.open,
|
|
@@ -1882,8 +1886,9 @@ Safety:
|
|
|
1882
1886
|
Provision caches the approved developer token and service credentials under
|
|
1883
1887
|
.odla/ with mode 0600, and init adds those paths to .gitignore. Secret push
|
|
1884
1888
|
preflights Wrangler before any shown-once issuance or destructive rotation.
|
|
1885
|
-
Provision opens the approval page automatically
|
|
1886
|
-
|
|
1889
|
+
Provision opens the approval page in your browser automatically whenever the
|
|
1890
|
+
machine can show one, including agent-driven runs; only CI, SSH, and
|
|
1891
|
+
display-less hosts skip it. Use --open to force or --no-open to suppress.
|
|
1887
1892
|
A fresh device handshake requires --email <odla-account> or ODLA_USER_EMAIL.
|
|
1888
1893
|
The email is a non-secret identity hint: never provide a password or session
|
|
1889
1894
|
token. The matching account must already exist, be signed in, explicitly
|
|
@@ -2393,7 +2398,6 @@ ${env}: credentials are already saved; retry "odla-ai secrets push --env ${env}$
|
|
|
2393
2398
|
{ platform: cfg.platformUrl, appId: cfg.app.id, env, token, fetch: doFetch },
|
|
2394
2399
|
{
|
|
2395
2400
|
open: options.open,
|
|
2396
|
-
interactive: options.interactive,
|
|
2397
2401
|
openConsentUrl: options.openApprovalUrl,
|
|
2398
2402
|
wait: options.calendarPollWait,
|
|
2399
2403
|
pollTimeoutMs: options.calendarPollTimeoutMs,
|
|
@@ -3704,7 +3708,6 @@ async function smoke(options) {
|
|
|
3704
3708
|
token: options.token,
|
|
3705
3709
|
email: options.email,
|
|
3706
3710
|
open: options.open,
|
|
3707
|
-
interactive: options.interactive,
|
|
3708
3711
|
openApprovalUrl: options.openApprovalUrl
|
|
3709
3712
|
},
|
|
3710
3713
|
doFetch,
|