crewly 1.20.141 → 1.20.142
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/dist/backend/backend/src/constants.d.ts +2 -0
- package/dist/backend/backend/src/constants.d.ts.map +1 -1
- package/dist/backend/backend/src/constants.js +2 -0
- package/dist/backend/backend/src/constants.js.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts +19 -0
- package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.js +41 -2
- package/dist/backend/backend/src/services/agent/agent-registration.service.js.map +1 -1
- package/dist/backend/backend/src/services/harness/harness-relogin.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/harness/harness-relogin.service.js +15 -0
- package/dist/backend/backend/src/services/harness/harness-relogin.service.js.map +1 -1
- package/dist/backend/backend/src/services/harness/login-expiry-rules.d.ts.map +1 -1
- package/dist/backend/backend/src/services/harness/login-expiry-rules.js +8 -0
- package/dist/backend/backend/src/services/harness/login-expiry-rules.js.map +1 -1
- package/dist/backend/build-info.json +2 -2
- package/dist/cli/backend/src/constants.d.ts +2 -0
- package/dist/cli/backend/src/constants.d.ts.map +1 -1
- package/dist/cli/backend/src/constants.js +2 -0
- package/dist/cli/backend/src/constants.js.map +1 -1
- package/dist/cli/backend/src/services/agent/agent-registration.service.d.ts +19 -0
- package/dist/cli/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/agent/agent-registration.service.js +41 -2
- package/dist/cli/backend/src/services/agent/agent-registration.service.js.map +1 -1
- package/dist/cli/backend/src/services/harness/harness-relogin.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/harness/harness-relogin.service.js +15 -0
- package/dist/cli/backend/src/services/harness/harness-relogin.service.js.map +1 -1
- package/dist/cli/backend/src/services/harness/login-expiry-rules.d.ts.map +1 -1
- package/dist/cli/backend/src/services/harness/login-expiry-rules.js +8 -0
- package/dist/cli/backend/src/services/harness/login-expiry-rules.js.map +1 -1
- package/package.json +1 -1
|
@@ -1474,9 +1474,11 @@ export class AgentRegistrationService {
|
|
|
1474
1474
|
// every log line still said "sent successfully" (server-install finding 3).
|
|
1475
1475
|
if (cancelled())
|
|
1476
1476
|
return;
|
|
1477
|
-
await this.waitForRuntimeInputReady(sessionName, runtimeType, signal);
|
|
1477
|
+
const inputReady = await this.waitForRuntimeInputReady(sessionName, runtimeType, signal);
|
|
1478
1478
|
if (cancelled())
|
|
1479
1479
|
return;
|
|
1480
|
+
if (!inputReady && (await this.isOnSignInScreen(sessionName)))
|
|
1481
|
+
return;
|
|
1480
1482
|
const sent = await this.sendPromptRobustly(sessionName, prompt, runtimeType, signal);
|
|
1481
1483
|
if (sent) {
|
|
1482
1484
|
this.logger.info('Registration prompt sent successfully', { sessionName, role });
|
|
@@ -1504,6 +1506,30 @@ export class AgentRegistrationService {
|
|
|
1504
1506
|
this.registrationFlows.end(flow);
|
|
1505
1507
|
}
|
|
1506
1508
|
}
|
|
1509
|
+
/**
|
|
1510
|
+
* Whether the runtime is sitting on its sign-in screen. Typing the kickoff
|
|
1511
|
+
* there after the input-ready timeout put the instruction text into
|
|
1512
|
+
* Codex's "Provide your own API key" box: it became the "API key", every
|
|
1513
|
+
* call 401'd, and the 401 set off a re-login that wiped the owner's fresh
|
|
1514
|
+
* ChatGPT sign-in (2026-09-26, Nova). Nothing is typed; the login monitor
|
|
1515
|
+
* sees the screen and asks the owner to sign in.
|
|
1516
|
+
*
|
|
1517
|
+
* @param sessionName - Session
|
|
1518
|
+
* @returns True when the screen is a sign-in / login prompt
|
|
1519
|
+
*/
|
|
1520
|
+
async isOnSignInScreen(sessionName) {
|
|
1521
|
+
let screen = '';
|
|
1522
|
+
try {
|
|
1523
|
+
screen = (await this.getSessionHelper()).capturePane(sessionName);
|
|
1524
|
+
}
|
|
1525
|
+
catch {
|
|
1526
|
+
return false;
|
|
1527
|
+
}
|
|
1528
|
+
if (!isSignInScreen(screen))
|
|
1529
|
+
return false;
|
|
1530
|
+
this.logger.warn('Runtime is on its sign-in screen — not typing the registration instruction into it', { sessionName });
|
|
1531
|
+
return true;
|
|
1532
|
+
}
|
|
1507
1533
|
/**
|
|
1508
1534
|
* Poll the PTY screen until the runtime is idle at its input prompt
|
|
1509
1535
|
* (`RuntimeAgentService.isReadyForInput`) or the timeout elapses.
|
|
@@ -1625,9 +1651,11 @@ export class AgentRegistrationService {
|
|
|
1625
1651
|
this.logger.warn('No registration within timeout — re-delivering registration instruction', {
|
|
1626
1652
|
sessionName, role, runtimeType, timeoutMs: timeout,
|
|
1627
1653
|
});
|
|
1628
|
-
await this.waitForRuntimeInputReady(sessionName, runtimeType, abortSignal);
|
|
1654
|
+
const readyAgain = await this.waitForRuntimeInputReady(sessionName, runtimeType, abortSignal);
|
|
1629
1655
|
if (this.isFlowCancelled(sessionName, abortSignal))
|
|
1630
1656
|
return;
|
|
1657
|
+
if (!readyAgain && (await this.isOnSignInScreen(sessionName)))
|
|
1658
|
+
return;
|
|
1631
1659
|
const resent = await this.sendPromptRobustly(sessionName, prompt, runtimeType, abortSignal);
|
|
1632
1660
|
this.logger.info('registration re-delivered', { sessionName, role, runtimeType, resent });
|
|
1633
1661
|
}
|
|
@@ -5513,4 +5541,15 @@ export function codexHasOwnLogin(env = process.env) {
|
|
|
5513
5541
|
const home = env.CODEX_HOME && env.CODEX_HOME.length > 0 ? env.CODEX_HOME : path.join(os.homedir(), '.codex');
|
|
5514
5542
|
return existsSync(path.join(home, 'auth.json'));
|
|
5515
5543
|
}
|
|
5544
|
+
/** Sign-in prompts of the CLI runtimes (compared with spaces removed: TUIs drop them). */
|
|
5545
|
+
const SIGN_IN_SCREEN = /signinwithchatgpt|provideyourownapikey|signinwithdevicecode|pastecodehereifprompted|usetheurlbelowtosignin|loginwithgoogle/i;
|
|
5546
|
+
/**
|
|
5547
|
+
* Whether a captured screen is a runtime's sign-in / login prompt.
|
|
5548
|
+
*
|
|
5549
|
+
* @param screen - Captured terminal text
|
|
5550
|
+
* @returns True for a sign-in screen
|
|
5551
|
+
*/
|
|
5552
|
+
export function isSignInScreen(screen) {
|
|
5553
|
+
return SIGN_IN_SCREEN.test((screen ?? '').replace(/\s+/g, ''));
|
|
5554
|
+
}
|
|
5516
5555
|
//# sourceMappingURL=agent-registration.service.js.map
|