mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
refactor(binary): share session status options (#17057)
This commit is contained in:
1 parent
01f4bf79c0
commit
37da005e14
3 files changed
+12
-23
No files matched your search
@@ -67,6 +67,7 @@ import { BinarySessionRecords } from "./BinarySessionRecords.js";
|
||||
import {
|
||||
binarySessionStatus,
|
||||
currentRouteCapability,
|
||||
type BinarySessionStatusOptions,
|
||||
} from "./BinarySessionStatus.js";
|
||||
import { SessionRuntimeAvailability } from "./SessionRuntimeAvailability.js";
|
||||
import {
|
||||
@@ -76,7 +77,6 @@ import {
|
||||
requiresNativeSourceAdmissionBeforeReplay,
|
||||
snapshotNotSavedLimitation,
|
||||
} from "./AnalysisSnapshotCache.js";
|
||||
import type { BinarySessionDetail } from "../../contracts/sessionStatusContract.js";
|
||||
import {
|
||||
resolveSessionOpen,
|
||||
resolveSessionTarget,
|
||||
@@ -1355,24 +1355,14 @@ export class BinarySession
|
||||
}
|
||||
|
||||
/** Describe the active binary session. */
|
||||
status(
|
||||
options: {
|
||||
readonly signal?: AbortSignal;
|
||||
readonly detail?: BinarySessionDetail;
|
||||
readonly refreshCandidates?: boolean;
|
||||
} = {},
|
||||
): Promise<JsonValue> {
|
||||
status(options: BinarySessionStatusOptions = {}): Promise<JsonValue> {
|
||||
return options.refreshCandidates === true
|
||||
? this.#serialize(() => this.#status(options), { abortPrompts: false })
|
||||
: this.#status(options);
|
||||
}
|
||||
|
||||
/** Keep an explicit candidate refresh ordered with target transitions. */
|
||||
#status(options: {
|
||||
readonly signal?: AbortSignal;
|
||||
readonly detail?: BinarySessionDetail;
|
||||
readonly refreshCandidates?: boolean;
|
||||
}): Promise<JsonValue> {
|
||||
#status(options: BinarySessionStatusOptions): Promise<JsonValue> {
|
||||
const resourceRun = this.#activeBundleResources;
|
||||
const run =
|
||||
this.#active ??
|
||||
|
||||
@@ -7,7 +7,7 @@ import type { BinaryTarget } from "../../domain/binaryTargetTypes.js";
|
||||
import type { JsonValue } from "../../domain/jsonValue.js";
|
||||
import type { AnalysisSnapshot } from "../../domain/analysisSnapshot.js";
|
||||
import type { AnalysisProfileCommitment } from "../../domain/analysisProfile.js";
|
||||
import type { BinarySessionDetail } from "../../contracts/sessionStatusContract.js";
|
||||
import type { BinarySessionStatusOptions } from "./BinarySessionStatus.js";
|
||||
import type { AnalysisError } from "../../domain/analysisErrorBase.js";
|
||||
import type { AnalysisCleanupRetry } from "../../domain/analysisErrorRecovery.js";
|
||||
import type { Result } from "../../domain/result.js";
|
||||
@@ -137,11 +137,7 @@ export interface BinarySessionPort
|
||||
},
|
||||
): Promise<Result<ClosedWithSnapshot, AnalysisError>>;
|
||||
/** Default complete detail; summary omits provider diagnostics and candidate capabilities. */
|
||||
status(options?: {
|
||||
readonly signal?: AbortSignal;
|
||||
readonly detail?: BinarySessionDetail;
|
||||
readonly refreshCandidates?: boolean;
|
||||
}): Promise<JsonValue>;
|
||||
status(options?: BinarySessionStatusOptions): Promise<JsonValue>;
|
||||
activeTarget(): BinaryTarget | undefined;
|
||||
/** What the session holds now, as session admission reads it. */
|
||||
sessionLane(): SessionLane;
|
||||
|
||||
@@ -32,7 +32,13 @@ import type { BinarySessionDetail } from "../../contracts/sessionStatusContract.
|
||||
import type { AnalysisCleanupRetry } from "../../domain/analysisErrorRecovery.js";
|
||||
import type { ProviderSelectionRejection } from "../../domain/providerSelectionError.js";
|
||||
|
||||
interface BinarySessionStatusInput {
|
||||
export interface BinarySessionStatusOptions {
|
||||
readonly detail?: BinarySessionDetail;
|
||||
readonly signal?: AbortSignal;
|
||||
readonly refreshCandidates?: boolean;
|
||||
}
|
||||
|
||||
interface BinarySessionStatusInput extends BinarySessionStatusOptions {
|
||||
readonly investigation: InvestigationStatistics;
|
||||
readonly target: BinaryTarget | undefined;
|
||||
readonly bundleResourceRoot?: ResolvedAppBundleResourceRoot;
|
||||
@@ -49,9 +55,6 @@ interface BinarySessionStatusInput {
|
||||
readonly providerOperationHealth?: ProviderOperationHealth | null;
|
||||
readonly cleanupPending?: boolean;
|
||||
readonly cleanupRetry?: AnalysisCleanupRetry;
|
||||
readonly detail?: BinarySessionDetail;
|
||||
readonly signal?: AbortSignal;
|
||||
readonly refreshCandidates?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user