mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
refactor: prune stale extension types
This commit is contained in:
@@ -126,15 +126,6 @@ export type BlueBubblesAccountConfig = {
|
||||
coalesceSameSenderDms?: boolean;
|
||||
};
|
||||
|
||||
export type BlueBubblesConfig = Omit<BlueBubblesAccountConfig, "actions"> & {
|
||||
/** Optional per-account BlueBubbles configuration (multi-account). */
|
||||
accounts?: Record<string, BlueBubblesAccountConfig>;
|
||||
/** Optional default account id when multiple accounts are configured. */
|
||||
defaultAccount?: string;
|
||||
/** Per-action tool gating (default: true for all). */
|
||||
actions?: BlueBubblesActionConfig;
|
||||
};
|
||||
|
||||
export type BlueBubblesSendTarget =
|
||||
| { kind: "chat_id"; chatId: number }
|
||||
| { kind: "chat_guid"; chatGuid: string }
|
||||
|
||||
@@ -2,14 +2,11 @@ import type {
|
||||
ClientRequest as GeneratedClientRequest,
|
||||
InitializeParams as GeneratedInitializeParams,
|
||||
InitializeResponse as GeneratedInitializeResponse,
|
||||
ServerNotification as GeneratedServerNotification,
|
||||
ServerRequest as GeneratedServerRequest,
|
||||
ServiceTier as GeneratedServiceTier,
|
||||
v2,
|
||||
} from "./protocol-generated/typescript/index.js";
|
||||
import type { JsonValue as GeneratedJsonValue } from "./protocol-generated/typescript/serde_json/JsonValue.js";
|
||||
|
||||
export type JsonPrimitive = null | boolean | number | string;
|
||||
export type JsonValue = GeneratedJsonValue;
|
||||
export type JsonObject = { [key: string]: JsonValue };
|
||||
export type CodexServiceTier = GeneratedServiceTier;
|
||||
@@ -65,29 +62,17 @@ export type CodexTurnStartParams = v2.TurnStartParams;
|
||||
|
||||
export type CodexSandboxPolicy = v2.SandboxPolicy;
|
||||
|
||||
export type CodexTurnSteerParams = v2.TurnSteerParams;
|
||||
|
||||
export type CodexTurnInterruptParams = {
|
||||
threadId: string;
|
||||
turnId: string;
|
||||
};
|
||||
|
||||
export type CodexTurnStartResponse = v2.TurnStartResponse;
|
||||
|
||||
export type CodexThread = v2.Thread;
|
||||
|
||||
export type CodexTurn = v2.Turn;
|
||||
|
||||
export type CodexThreadItem = v2.ThreadItem;
|
||||
|
||||
export type CodexKnownServerNotification = GeneratedServerNotification;
|
||||
export type CodexServerNotification = {
|
||||
method: string;
|
||||
params?: JsonValue;
|
||||
};
|
||||
|
||||
export type CodexKnownServerRequest = GeneratedServerRequest;
|
||||
|
||||
export type CodexDynamicToolCallParams = v2.DynamicToolCallParams;
|
||||
|
||||
export type CodexDynamicToolCallResponse = v2.DynamicToolCallResponse;
|
||||
@@ -123,10 +108,3 @@ export function isJsonObject(value: JsonValue | undefined): value is JsonObject
|
||||
export function isRpcResponse(message: RpcMessage): message is RpcResponse {
|
||||
return "id" in message && !("method" in message);
|
||||
}
|
||||
|
||||
export function coerceJsonObject(value: unknown): JsonObject | undefined {
|
||||
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
||||
return undefined;
|
||||
}
|
||||
return value as JsonObject;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
type DiffLayout,
|
||||
type DiffMode,
|
||||
type DiffOutputFormat,
|
||||
type DiffPresentationDefaults,
|
||||
type DiffTheme,
|
||||
type DiffToolDefaults,
|
||||
} from "./types.js";
|
||||
@@ -314,31 +313,6 @@ export function resolveDiffsPluginViewerBaseUrl(config: unknown): string | undef
|
||||
return normalized ? normalizeViewerBaseUrl(normalized) : undefined;
|
||||
}
|
||||
|
||||
export function toPresentationDefaults(defaults: DiffToolDefaults): DiffPresentationDefaults {
|
||||
const {
|
||||
fontFamily,
|
||||
fontSize,
|
||||
lineSpacing,
|
||||
layout,
|
||||
showLineNumbers,
|
||||
diffIndicators,
|
||||
wordWrap,
|
||||
background,
|
||||
theme,
|
||||
} = defaults;
|
||||
return {
|
||||
fontFamily,
|
||||
fontSize,
|
||||
lineSpacing,
|
||||
layout,
|
||||
showLineNumbers,
|
||||
diffIndicators,
|
||||
wordWrap,
|
||||
background,
|
||||
theme,
|
||||
};
|
||||
}
|
||||
|
||||
function normalizeFontFamily(fontFamily?: string): string {
|
||||
const normalized = fontFamily?.trim();
|
||||
return normalized || DEFAULT_DIFFS_TOOL_DEFAULTS.fontFamily;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
||||
import { resolveDefaultDiscordAccountId } from "../accounts.js";
|
||||
import { createDiscordRuntimeAccountContext } from "../client.js";
|
||||
import {
|
||||
@@ -33,10 +32,6 @@ export type DiscordMessagingActionContext = {
|
||||
normalizeMessage: (message: unknown) => unknown;
|
||||
};
|
||||
|
||||
export type DiscordMessagingActionHandler = (
|
||||
ctx: DiscordMessagingActionContext,
|
||||
) => Promise<AgentToolResult<unknown> | undefined>;
|
||||
|
||||
export function createDiscordMessagingActionContext(params: {
|
||||
action: string;
|
||||
input: Record<string, unknown>;
|
||||
|
||||
@@ -1,43 +1 @@
|
||||
type PathEnvKey = "PATH" | "Path" | "PATHEXT" | "Pathext";
|
||||
|
||||
export { createWindowsCmdShimFixture } from "openclaw/plugin-sdk/test-env";
|
||||
const PATH_ENV_KEYS = ["PATH", "Path", "PATHEXT", "Pathext"] as const;
|
||||
|
||||
export type PlatformPathEnvSnapshot = {
|
||||
platformDescriptor: PropertyDescriptor | undefined;
|
||||
env: Record<PathEnvKey, string | undefined>;
|
||||
};
|
||||
|
||||
export function setProcessPlatform(platform: NodeJS.Platform): void {
|
||||
Object.defineProperty(process, "platform", {
|
||||
value: platform,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
|
||||
export function snapshotPlatformPathEnv(): PlatformPathEnvSnapshot {
|
||||
return {
|
||||
platformDescriptor: Object.getOwnPropertyDescriptor(process, "platform"),
|
||||
env: {
|
||||
PATH: process.env.PATH,
|
||||
Path: process.env.Path,
|
||||
PATHEXT: process.env.PATHEXT,
|
||||
Pathext: process.env.Pathext,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export function restorePlatformPathEnv(snapshot: PlatformPathEnvSnapshot): void {
|
||||
if (snapshot.platformDescriptor) {
|
||||
Object.defineProperty(process, "platform", snapshot.platformDescriptor);
|
||||
}
|
||||
|
||||
for (const key of PATH_ENV_KEYS) {
|
||||
const value = snapshot.env[key];
|
||||
if (value === undefined) {
|
||||
delete process.env[key];
|
||||
continue;
|
||||
}
|
||||
process.env[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import {
|
||||
AllowFromListSchema,
|
||||
buildChannelConfigSchema,
|
||||
DmPolicySchema,
|
||||
MarkdownConfigSchema,
|
||||
} from "openclaw/plugin-sdk/channel-config-primitives";
|
||||
@@ -97,10 +96,3 @@ export const NostrConfigSchema = z.object({
|
||||
/** Profile metadata (NIP-01 kind:0 content) */
|
||||
profile: NostrProfileSchema.optional(),
|
||||
});
|
||||
|
||||
export type NostrConfig = z.infer<typeof NostrConfigSchema>;
|
||||
|
||||
/**
|
||||
* JSON Schema for Control UI (converted from Zod)
|
||||
*/
|
||||
export const nostrChannelConfigSchema = buildChannelConfigSchema(NostrConfigSchema);
|
||||
|
||||
@@ -61,7 +61,6 @@ const listCredentialsResponseSchema = z.object({
|
||||
|
||||
export type QaCredentialAdminListStatus = z.infer<typeof listStatusSchema>;
|
||||
export type QaCredentialRecord = z.infer<typeof credentialRecordSchema>;
|
||||
export type QaCredentialListResponse = z.infer<typeof listCredentialsResponseSchema>;
|
||||
|
||||
export class QaCredentialAdminError extends Error {
|
||||
code: string;
|
||||
|
||||
@@ -65,16 +65,6 @@ export interface TwitchAccountConfig {
|
||||
obtainmentTimestamp?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Message target for Twitch
|
||||
*/
|
||||
export interface TwitchTarget {
|
||||
/** Account ID */
|
||||
accountId: string;
|
||||
/** Channel name (defaults to account's channel) */
|
||||
channel?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Twitch message from chat
|
||||
*/
|
||||
@@ -132,10 +122,5 @@ export type {
|
||||
OutboundDeliveryResult,
|
||||
};
|
||||
|
||||
import type { z } from "openclaw/plugin-sdk/zod";
|
||||
// Import and re-export the schema type
|
||||
import type { TwitchConfigSchema } from "./config-schema.js";
|
||||
export type TwitchConfig = z.infer<typeof TwitchConfigSchema>;
|
||||
|
||||
export type { OpenClawConfig };
|
||||
export type { RuntimeEnv };
|
||||
|
||||
@@ -39,7 +39,6 @@ export const E164Schema = z
|
||||
* - "open": Accept all inbound calls (dangerous!)
|
||||
*/
|
||||
export const InboundPolicySchema = z.enum(["disabled", "allowlist", "pairing", "open"]);
|
||||
export type InboundPolicy = z.infer<typeof InboundPolicySchema>;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Provider-Specific Configuration
|
||||
|
||||
@@ -290,30 +290,3 @@ export type OutboundCallOptions = {
|
||||
/** DTMF digits to send after the call is connected */
|
||||
dtmfSequence?: string;
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Tool Result Types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
export type InitiateCallToolResult = {
|
||||
success: boolean;
|
||||
callId?: string;
|
||||
status?: "initiated" | "queued" | "no-answer" | "busy" | "failed";
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export type ContinueCallToolResult = {
|
||||
success: boolean;
|
||||
transcript?: string;
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export type SpeakToUserToolResult = {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
};
|
||||
|
||||
export type EndCallToolResult = {
|
||||
success: boolean;
|
||||
error?: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user