|
1 | 1 | import { failCommand, failUsage, requestCliExit } from "../../utils/commandResult.js"; |
2 | | -import { envFlagEnabled, isAttendedTerminal, isCI } from "../../utils/attendedTerminal.js"; |
| 2 | +import { envFlagEnabled, isCI } from "../../utils/attendedTerminal.js"; |
3 | 3 | import { isAgentDriven } from "../../telemetry/agent_runtime.js"; |
4 | 4 | /** |
5 | 5 | * `hyperframes auth login` — sign in to HeyGen. |
@@ -70,7 +70,8 @@ export default defineCommand({ |
70 | 70 | }, |
71 | 71 | device: { |
72 | 72 | type: "boolean", |
73 | | - description: "Use an attended device code (for SSH/headless terminals; never for CI).", |
| 73 | + description: |
| 74 | + "Use a device code approved in any browser (for SSH, headless or agent-run terminals; never for CI).", |
74 | 75 | }, |
75 | 76 | }, |
76 | 77 | // fallow-ignore-next-line complexity |
@@ -123,19 +124,19 @@ function agentShellOnThisMachine(): boolean { |
123 | 124 | return !isCI() && isAgentDriven(); |
124 | 125 | } |
125 | 126 |
|
126 | | -function assertAttendedDeviceFlow(): void { |
127 | | - if (!isAttendedTerminal()) { |
| 127 | +function assertDeviceFlowAllowed(): void { |
| 128 | + if (isCI()) { |
128 | 129 | console.error( |
129 | 130 | c.error( |
130 | | - "`--device` requires an attended terminal and is disabled in CI. Use an API key or workload credential for automation.", |
| 131 | + "`--device` needs a person to approve it and is disabled in CI. Use an API key or workload credential for automation.", |
131 | 132 | ), |
132 | 133 | ); |
133 | 134 | failUsage(); |
134 | 135 | } |
135 | 136 | } |
136 | 137 |
|
137 | 138 | async function runDeviceLogin(): Promise<void> { |
138 | | - assertAttendedDeviceFlow(); |
| 139 | + assertDeviceFlowAllowed(); |
139 | 140 | assertOAuthConfiguredOrExit(); |
140 | 141 | const { trackAuthLoginStarted, trackAuthLoginCompleted, trackAuthLoginFailed, identifyUser } = |
141 | 142 | await import("../../telemetry/index.js"); |
|
0 commit comments