mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 09:41:11 +00:00
fix(test): restore doctor and acpx type guards
This commit is contained in:
56
extensions/acpx/src/acpx-runtime.d.ts
vendored
Normal file
56
extensions/acpx/src/acpx-runtime.d.ts
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
declare module "acpx/dist/runtime.js" {
|
||||
import type {
|
||||
AcpRuntimeCapabilities,
|
||||
AcpRuntimeDoctorReport,
|
||||
AcpRuntimeEvent,
|
||||
AcpRuntimeHandle,
|
||||
AcpRuntimeStatus,
|
||||
} from "../../../src/acp/runtime/types.js";
|
||||
|
||||
export const ACPX_BACKEND_ID: string;
|
||||
export type { AcpRuntimeDoctorReport, AcpRuntimeEvent, AcpRuntimeHandle, AcpRuntimeStatus };
|
||||
|
||||
export type AcpSessionRecord = {
|
||||
name?: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export type AcpSessionStore = {
|
||||
load: (sessionId: string) => Promise<AcpSessionRecord | undefined>;
|
||||
save: (record: AcpSessionRecord) => Promise<void>;
|
||||
};
|
||||
|
||||
export type AcpAgentRegistry = {
|
||||
resolve: (agentId: string) => string;
|
||||
list: () => string[];
|
||||
};
|
||||
|
||||
export type AcpRuntimeOptions = {
|
||||
cwd: string;
|
||||
sessionStore: AcpSessionStore;
|
||||
agentRegistry: AcpAgentRegistry;
|
||||
permissionMode?: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export class AcpxRuntime {
|
||||
constructor(options: AcpRuntimeOptions, testOptions?: unknown);
|
||||
isHealthy(): boolean;
|
||||
probeAvailability(): Promise<void>;
|
||||
doctor(): Promise<AcpRuntimeDoctorReport>;
|
||||
ensureSession(input: unknown): Promise<AcpRuntimeHandle>;
|
||||
runTurn(input: unknown): AsyncIterable<AcpRuntimeEvent>;
|
||||
getCapabilities(input?: { handle?: AcpRuntimeHandle }): AcpRuntimeCapabilities;
|
||||
getStatus(input: unknown): Promise<AcpRuntimeStatus>;
|
||||
setMode(input: unknown): Promise<void>;
|
||||
setConfigOption(input: unknown): Promise<void>;
|
||||
cancel(input: unknown): Promise<void>;
|
||||
close(input: unknown): Promise<void>;
|
||||
}
|
||||
|
||||
export function createAcpRuntime(...args: unknown[]): AcpxRuntime;
|
||||
export function createAgentRegistry(...args: unknown[]): AcpAgentRegistry;
|
||||
export function createFileSessionStore(...args: unknown[]): AcpSessionStore;
|
||||
export function decodeAcpxRuntimeHandleState(...args: unknown[]): unknown;
|
||||
export function encodeAcpxRuntimeHandleState(...args: unknown[]): unknown;
|
||||
}
|
||||
@@ -2,6 +2,8 @@ import { isRecord } from "../../../utils.js";
|
||||
|
||||
type JsonRecord = Record<string, unknown>;
|
||||
|
||||
import { isRecord } from "../../../utils.js";
|
||||
|
||||
export type { JsonRecord };
|
||||
export { isRecord };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user