mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix: restore lint/build gates
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
"oxc/no-map-spread": "off",
|
"oxc/no-map-spread": "off",
|
||||||
"typescript/no-explicit-any": "error",
|
"typescript/no-explicit-any": "error",
|
||||||
"typescript/no-extraneous-class": "off",
|
"typescript/no-extraneous-class": "off",
|
||||||
|
"typescript/no-redundant-type-constituents": "off",
|
||||||
"typescript/no-unsafe-type-assertion": "off",
|
"typescript/no-unsafe-type-assertion": "off",
|
||||||
"unicorn/consistent-function-scoping": "off",
|
"unicorn/consistent-function-scoping": "off",
|
||||||
"unicorn/require-post-message-target-origin": "off"
|
"unicorn/require-post-message-target-origin": "off"
|
||||||
|
|||||||
@@ -105,9 +105,9 @@
|
|||||||
"ios:gen": "cd apps/ios && xcodegen generate",
|
"ios:gen": "cd apps/ios && xcodegen generate",
|
||||||
"ios:open": "cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj",
|
"ios:open": "cd apps/ios && xcodegen generate && open OpenClaw.xcodeproj",
|
||||||
"ios:run": "bash -lc 'cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'",
|
"ios:run": "bash -lc 'cd apps/ios && xcodegen generate && xcodebuild -project OpenClaw.xcodeproj -scheme OpenClaw -destination \"${IOS_DEST:-platform=iOS Simulator,name=iPhone 17}\" -configuration Debug build && xcrun simctl boot \"${IOS_SIM:-iPhone 17}\" || true && xcrun simctl launch booted ai.openclaw.ios'",
|
||||||
"lint": "oxlint --type-aware",
|
"lint": "oxlint --type-aware --tsconfig tsconfig.oxlint.json",
|
||||||
"lint:all": "pnpm lint && pnpm lint:swift",
|
"lint:all": "pnpm lint && pnpm lint:swift",
|
||||||
"lint:fix": "oxlint --type-aware --fix && pnpm format:fix",
|
"lint:fix": "oxlint --type-aware --tsconfig tsconfig.oxlint.json --fix && pnpm format:fix",
|
||||||
"lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)",
|
"lint:swift": "swiftlint lint --config .swiftlint.yml && (cd apps/ios && swiftlint lint --config .swiftlint.yml)",
|
||||||
"mac:open": "open dist/OpenClaw.app",
|
"mac:open": "open dist/OpenClaw.app",
|
||||||
"mac:package": "bash scripts/package-mac-app.sh",
|
"mac:package": "bash scripts/package-mac-app.sh",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const OAUTH_PROVIDER_IDS = new Set<OAuthProvider>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const isOAuthProvider = (provider: string): provider is OAuthProvider =>
|
const isOAuthProvider = (provider: string): provider is OAuthProvider =>
|
||||||
OAUTH_PROVIDER_IDS.has(provider);
|
OAUTH_PROVIDER_IDS.has(provider as OAuthProvider);
|
||||||
|
|
||||||
const resolveOAuthProvider = (provider: string): OAuthProvider | null =>
|
const resolveOAuthProvider = (provider: string): OAuthProvider | null =>
|
||||||
isOAuthProvider(provider) ? provider : null;
|
isOAuthProvider(provider) ? provider : null;
|
||||||
|
|||||||
@@ -74,8 +74,11 @@ export function buildEmbeddedSystemPrompt(params: {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createSystemPromptOverride(systemPrompt: string): string {
|
export function createSystemPromptOverride(
|
||||||
return systemPrompt.trim();
|
systemPrompt: string,
|
||||||
|
): (defaultPrompt?: string) => string {
|
||||||
|
const override = systemPrompt.trim();
|
||||||
|
return (_defaultPrompt?: string) => override;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function applySystemPromptOverrideToSession(session: AgentSession, override: string) {
|
export function applySystemPromptOverrideToSession(session: AgentSession, override: string) {
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ export function toToolDefinitions(tools: AnyAgentTool[]): ToolDefinition[] {
|
|||||||
execute: async (
|
execute: async (
|
||||||
toolCallId,
|
toolCallId,
|
||||||
params,
|
params,
|
||||||
signal,
|
|
||||||
onUpdate: AgentToolUpdateCallback<unknown> | undefined,
|
onUpdate: AgentToolUpdateCallback<unknown> | undefined,
|
||||||
_ctx,
|
_ctx,
|
||||||
|
signal,
|
||||||
): Promise<AgentToolResult<unknown>> => {
|
): Promise<AgentToolResult<unknown>> => {
|
||||||
try {
|
try {
|
||||||
return await tool.execute(toolCallId, params, signal, onUpdate);
|
return await tool.execute(toolCallId, params, signal, onUpdate);
|
||||||
@@ -91,9 +91,9 @@ export function toClientToolDefinitions(
|
|||||||
execute: async (
|
execute: async (
|
||||||
toolCallId,
|
toolCallId,
|
||||||
params,
|
params,
|
||||||
_signal,
|
|
||||||
_onUpdate: AgentToolUpdateCallback<unknown> | undefined,
|
_onUpdate: AgentToolUpdateCallback<unknown> | undefined,
|
||||||
_ctx,
|
_ctx,
|
||||||
|
_signal,
|
||||||
): Promise<AgentToolResult<unknown>> => {
|
): Promise<AgentToolResult<unknown>> => {
|
||||||
const outcome = await runBeforeToolCallHook({
|
const outcome = await runBeforeToolCallHook({
|
||||||
toolName: func.name,
|
toolName: func.name,
|
||||||
|
|||||||
17
tsconfig.oxlint.json
Normal file
17
tsconfig.oxlint.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"module": "NodeNext",
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"lib": ["DOM", "DOM.Iterable", "ES2023", "ScriptHost"],
|
||||||
|
"noEmit": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true,
|
||||||
|
"target": "es2023"
|
||||||
|
},
|
||||||
|
"include": ["src/**/*.ts", "extensions/**/*.ts"],
|
||||||
|
"exclude": ["node_modules", "dist"]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user