codexuse-cli 3.7.3 → 3.7.5
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/index.js +1 -1
- package/dist/server/index.mjs +34 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10249,7 +10249,7 @@ async function ensureCliStorageReady() {
|
|
|
10249
10249
|
}
|
|
10250
10250
|
|
|
10251
10251
|
// src/app/main.ts
|
|
10252
|
-
var VERSION = true ? "3.7.
|
|
10252
|
+
var VERSION = true ? "3.7.5" : "0.0.0";
|
|
10253
10253
|
async function runCli() {
|
|
10254
10254
|
const args = process.argv.slice(2);
|
|
10255
10255
|
if (args.length === 0) {
|
package/dist/server/index.mjs
CHANGED
|
@@ -24353,7 +24353,13 @@ const loadProjectedReadModelSummaryFromRepositories = (repositories) => gen(func
|
|
|
24353
24353
|
activities: [],
|
|
24354
24354
|
checkpoints: []
|
|
24355
24355
|
})));
|
|
24356
|
-
const
|
|
24356
|
+
const eagerlyHydratedThreadIds = threadSummaries.filter((thread) => thread.session !== null && thread.session.status !== "idle" && thread.session.status !== "stopped" && thread.session.status !== "ready").map((thread) => thread.id);
|
|
24357
|
+
yield* logInfo$1("Bootstrapping projected read model from projection tables", {
|
|
24358
|
+
projectCount: projects.length,
|
|
24359
|
+
threadCount: threadSummaries.length,
|
|
24360
|
+
eagerlyHydratedThreadCount: eagerlyHydratedThreadIds.length
|
|
24361
|
+
});
|
|
24362
|
+
const activeThreads = yield* forEach(eagerlyHydratedThreadIds, (threadId) => loadProjectedThreadFromRepositories(repositories, threadId), { concurrency: 4 });
|
|
24357
24363
|
const activeThreadById = new Map(activeThreads.filter((thread) => thread !== null).map((thread) => [thread.id, thread]));
|
|
24358
24364
|
const threads = threadSummaries.map((thread) => activeThreadById.get(thread.id) ?? thread);
|
|
24359
24365
|
const projectedProjects = projects.map(toOrchestrationProject);
|
|
@@ -40936,6 +40942,7 @@ var ProviderHealth = class extends Service()("t3/provider/Services/ProviderHealt
|
|
|
40936
40942
|
//#endregion
|
|
40937
40943
|
//#region src/provider/Layers/ProviderHealth.ts
|
|
40938
40944
|
const DEFAULT_TIMEOUT_MS = 4e3;
|
|
40945
|
+
const AUTH_STATUS_TIMEOUT_MS$1 = 8e3;
|
|
40939
40946
|
const CODEX_PROVIDER = "codex";
|
|
40940
40947
|
function nonEmptyTrimmed(value) {
|
|
40941
40948
|
if (!value) return void 0;
|
|
@@ -40955,6 +40962,15 @@ function detailFromResult(result) {
|
|
|
40955
40962
|
if (stdout) return stdout;
|
|
40956
40963
|
if (result.code !== 0) return `Command exited with code ${result.code}.`;
|
|
40957
40964
|
}
|
|
40965
|
+
function createPendingCodexStatus() {
|
|
40966
|
+
return {
|
|
40967
|
+
provider: CODEX_PROVIDER,
|
|
40968
|
+
status: "ready",
|
|
40969
|
+
available: true,
|
|
40970
|
+
authStatus: "unknown",
|
|
40971
|
+
checkedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
40972
|
+
};
|
|
40973
|
+
}
|
|
40958
40974
|
function extractAuthBoolean(value) {
|
|
40959
40975
|
if (isArray(value)) {
|
|
40960
40976
|
for (const entry of value) {
|
|
@@ -41165,7 +41181,7 @@ const checkCodexProviderStatus = gen(function* () {
|
|
|
41165
41181
|
checkedAt,
|
|
41166
41182
|
message: "Using a custom Codex model provider; OpenAI login check skipped."
|
|
41167
41183
|
};
|
|
41168
|
-
const authProbe = yield* runCodexCommand$1(["login", "status"], runtimeEnv).pipe(timeoutOption(
|
|
41184
|
+
const authProbe = yield* runCodexCommand$1(["login", "status"], runtimeEnv).pipe(timeoutOption(AUTH_STATUS_TIMEOUT_MS$1), result);
|
|
41169
41185
|
if (isFailure$1(authProbe)) {
|
|
41170
41186
|
const error = authProbe.failure;
|
|
41171
41187
|
return {
|
|
@@ -41200,7 +41216,7 @@ const ProviderHealthLive = effect(ProviderHealth, gen(function* () {
|
|
|
41200
41216
|
const path = yield* Path$1;
|
|
41201
41217
|
const childProcessSpawner = yield* ChildProcessSpawner;
|
|
41202
41218
|
const loadStatuses = checkCodexProviderStatus.pipe(map$2(of), provideService(FileSystem, fileSystem), provideService(Path$1, path), provideService(ChildProcessSpawner, childProcessSpawner));
|
|
41203
|
-
const statusesRef = yield* make$11(
|
|
41219
|
+
const statusesRef = yield* make$11([createPendingCodexStatus()]);
|
|
41204
41220
|
return {
|
|
41205
41221
|
getStatuses: get(statusesRef),
|
|
41206
41222
|
refreshStatuses: loadStatuses.pipe(tap((statuses) => set$1(statusesRef, statuses)))
|
|
@@ -45516,6 +45532,12 @@ function classifyRefreshFailure(error) {
|
|
|
45516
45532
|
retryable: false,
|
|
45517
45533
|
tokenIssue: "account-deactivated"
|
|
45518
45534
|
};
|
|
45535
|
+
if (normalized.includes("deactivated_workspace") || normalized.includes("workspace deactivated") || normalized.includes("402 payment required") && normalized.includes("/backend-api/wham/usage")) return {
|
|
45536
|
+
code: "workspace-deactivated",
|
|
45537
|
+
message: "Workspace deactivated. Restore workspace billing/access or remove this profile.",
|
|
45538
|
+
retryable: false,
|
|
45539
|
+
tokenIssue: "workspace-deactivated"
|
|
45540
|
+
};
|
|
45519
45541
|
if (normalized.includes("token_invalidated") || normalized.includes("authentication token has been invalidated")) return {
|
|
45520
45542
|
code: "token-expired",
|
|
45521
45543
|
message: "Session invalidated. Re-login this profile.",
|
|
@@ -45570,7 +45592,9 @@ async function performAccountRefresh(accountKeyValue, state) {
|
|
|
45570
45592
|
} catch (flagError) {
|
|
45571
45593
|
logError(`Failed to persist auth issue '${classification.tokenIssue}' for profile '${state.profileName}':`, flagError);
|
|
45572
45594
|
}
|
|
45573
|
-
|
|
45595
|
+
const message = `Failed to refresh rate-limit telemetry for account '${accountKeyValue}' using profile '${state.profileName}':`;
|
|
45596
|
+
if (classification.retryable) logError(message, error);
|
|
45597
|
+
else logWarn(message, classification.message);
|
|
45574
45598
|
return {
|
|
45575
45599
|
outcome: classification.retryable ? "retry" : "hold",
|
|
45576
45600
|
snapshot: null
|
|
@@ -49428,6 +49452,7 @@ async function assertProfileCreationAllowed(profileManager) {
|
|
|
49428
49452
|
//#endregion
|
|
49429
49453
|
//#region src/codex/runtimeInspection.ts
|
|
49430
49454
|
const COMMAND_TIMEOUT_MS = 5e3;
|
|
49455
|
+
const AUTH_STATUS_TIMEOUT_MS = 8e3;
|
|
49431
49456
|
const APP_SERVER_TIMEOUT_MS = 8e3;
|
|
49432
49457
|
const MODEL_LIST_TIMEOUT_MS = 5e3;
|
|
49433
49458
|
function tokenizeArgs(rawArgs) {
|
|
@@ -49741,7 +49766,7 @@ async function inspectCodexRuntime(input) {
|
|
|
49741
49766
|
"status"
|
|
49742
49767
|
]);
|
|
49743
49768
|
const authResult = await runCommand(authCommand.command, authCommand.args, {
|
|
49744
|
-
timeoutMs:
|
|
49769
|
+
timeoutMs: AUTH_STATUS_TIMEOUT_MS,
|
|
49745
49770
|
env
|
|
49746
49771
|
});
|
|
49747
49772
|
const parsedAuth = parseAuthStatusFromOutput({
|
|
@@ -51865,6 +51890,10 @@ const createServer = fn(function* () {
|
|
|
51865
51890
|
const agentChatConfig = getAgentChatConfig();
|
|
51866
51891
|
const generalChatConfig = getGeneralChatConfig();
|
|
51867
51892
|
yield* readiness.markPushBusReady;
|
|
51893
|
+
yield* forkScoped(providerHealth.refreshStatuses.pipe(tap((providers) => gen(function* () {
|
|
51894
|
+
yield* set$1(providersRef, providers);
|
|
51895
|
+
yield* pushBus.publishAll(WS_CHANNELS.serverProvidersUpdated, { providers });
|
|
51896
|
+
})), catch_((cause) => logWarning$1("failed to refresh provider health after server startup", { cause }))));
|
|
51868
51897
|
yield* keybindingsManager.start.pipe(mapError((cause) => new ServerLifecycleError({
|
|
51869
51898
|
operation: "keybindingsRuntimeStart",
|
|
51870
51899
|
cause
|