Add offline SQLite database/WAL inspection through the shared CLI/MCP. Use compact inventory, selected-table schema, exact ordered columns and bounded row samples while preserving source identity and lossless values. Retain completed Evidence through late cancellation and private-root cleanup failures, bound concurrent inspections, and recheck journal validity after acquisition. Reuse prepared CI runtime artifacts across supported Node lines. Co-authored-by: Y0UW1SH <29498139+Y0UW1SH@users.noreply.github.com> Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
|
|
import { jsonObjectSchema, type JsonValue } from "../domain/jsonValue.js";
|
|
import { createServerIdentity } from "../serverIdentity.js";
|
|
import { silentLogger } from "../logger.js";
|
|
import type { Logger } from "pino";
|
|
import type { DirectAnalysisDependencies } from "./DirectAnalysisDependencies.js";
|
|
import { providerCapabilitySet } from "../contracts/toolOutputSchemaPrimitives.js";
|
|
import { providerCapabilitySets } from "./binary/BinarySessionStatus.js";
|
|
import { sqliteDatabaseCapability } from "./sqlite/SqliteDatabaseCapability.js";
|
|
|
|
/** Read target-free provider status and operation availability. */
|
|
export const runSessionStatus = async (
|
|
dependencies: Pick<
|
|
DirectAnalysisDependencies,
|
|
"createBinarySession" | "readConfiguration"
|
|
>,
|
|
logger: Logger = silentLogger,
|
|
): Promise<JsonValue> => {
|
|
const config = dependencies.readConfiguration();
|
|
if (!config.ok) return { error: projectAnalysisError(config.error) };
|
|
const session = await dependencies.createBinarySession(config.value, logger);
|
|
try {
|
|
const status = jsonObjectSchema.parse(session.status());
|
|
return {
|
|
...status,
|
|
capabilities: [
|
|
...providerCapabilitySet.array().parse(status.capabilities),
|
|
...providerCapabilitySets([
|
|
sqliteDatabaseCapability(process.versions.node),
|
|
]),
|
|
],
|
|
server_identity: createServerIdentity({
|
|
startedAt: new Date().toISOString(),
|
|
}),
|
|
};
|
|
} finally {
|
|
await session.close();
|
|
}
|
|
};
|