refactor: centralize skills subsystem

This commit is contained in:
Shakker
2026-05-28 19:33:32 +01:00
committed by Shakker
parent dc7bd4abf5
commit 22e2d1560f
130 changed files with 734 additions and 301 deletions

View File

@@ -117,7 +117,7 @@ async function createAcpClient(opts: AcpClientOptions = {}): Promise<AcpClientHa
const defaultServerArgs = entryPath ? [entryPath, ...serverArgs] : serverArgs;
const serverCommand = opts.serverCommand ?? defaultServerCommand;
const effectiveArgs = opts.serverCommand || !entryPath ? serverArgs : defaultServerArgs;
const { getActiveSkillEnvKeys } = await import("../agents/skills/env-overrides.runtime.js");
const { getActiveSkillEnvKeys } = await import("../skills/env-overrides.runtime.js");
const stripProviderAuthEnvVars = shouldStripProviderAuthEnvVarsForAcpServer({
serverCommand,
serverArgs: effectiveArgs,

View File

@@ -596,16 +596,16 @@ vi.mock("./provider-auth-aliases.js", () => ({
provider.trim().toLowerCase() === "codex-cli" ? "openai-codex" : provider.trim().toLowerCase(),
}));
vi.mock("./skills.js", () => ({
vi.mock("../skills/index.js", () => ({
buildWorkspaceSkillSnapshot: (workspaceDir: string, opts: unknown) =>
state.buildWorkspaceSkillSnapshotMock(workspaceDir, opts),
}));
vi.mock("./skills/filter.js", () => ({
vi.mock("../skills/filter.js", () => ({
matchesSkillFilter: () => true,
}));
vi.mock("./skills/refresh-state.js", () => ({
vi.mock("../skills/refresh-state.js", () => ({
getSkillsSnapshotVersion: () => 0,
shouldRefreshSnapshotForVersion: () => false,
}));

View File

@@ -39,6 +39,8 @@ import {
import { resolveSendPolicy } from "../sessions/send-policy.js";
import { createLazyImportLoader } from "../shared/lazy-promise.js";
import { normalizeOptionalString } from "../shared/string-coerce.js";
import { hydrateResolvedSkillsAsync } from "../skills/snapshot-hydration.js";
import type { SkillSnapshot } from "../skills/types.js";
import { sanitizeForLog } from "../terminal/ansi.js";
import { createTrajectoryRuntimeRecorder } from "../trajectory/runtime.js";
import { resolveUserPath } from "../utils.js";
@@ -98,8 +100,6 @@ import {
} from "./model-visibility-policy.js";
import { listOpenAIAuthProfileProvidersForAgentRuntime } from "./openai-codex-routing.js";
import { resolveProviderIdForAuth } from "./provider-auth-aliases.js";
import { hydrateResolvedSkillsAsync } from "./skills/snapshot-hydration.js";
import type { SkillSnapshot } from "./skills/types.js";
import { normalizeSpawnedRunMetadata } from "./spawned-context.js";
import { resolveAgentTimeoutMs } from "./timeout.js";
import { ensureAgentWorkspace } from "./workspace.js";
@@ -117,9 +117,9 @@ type CliCompactionRuntime = typeof import("./command/cli-compaction.js");
type TranscriptResolveRuntime = typeof import("../config/sessions/transcript-resolve.runtime.js");
type CliDepsRuntime = typeof import("../cli/deps.js");
type ExecDefaultsRuntime = typeof import("./exec-defaults.js");
type SkillsRuntime = typeof import("./skills.js");
type SkillsFilterRuntime = typeof import("./skills/filter.js");
type SkillsRefreshStateRuntime = typeof import("./skills/refresh-state.js");
type SkillsRuntime = typeof import("../skills/index.js");
type SkillsFilterRuntime = typeof import("../skills/filter.js");
type SkillsRefreshStateRuntime = typeof import("../skills/refresh-state.js");
type SkillsRemoteRuntime = typeof import("../infra/skills-remote.js");
const attemptExecutionRuntimeLoader = createLazyImportLoader<AttemptExecutionRuntime>(
@@ -153,12 +153,14 @@ const cliDepsRuntimeLoader = createLazyImportLoader<CliDepsRuntime>(() => import
const execDefaultsRuntimeLoader = createLazyImportLoader<ExecDefaultsRuntime>(
() => import("./exec-defaults.js"),
);
const skillsRuntimeLoader = createLazyImportLoader<SkillsRuntime>(() => import("./skills.js"));
const skillsRuntimeLoader = createLazyImportLoader<SkillsRuntime>(
() => import("../skills/index.js"),
);
const skillsFilterRuntimeLoader = createLazyImportLoader<SkillsFilterRuntime>(
() => import("./skills/filter.js"),
() => import("../skills/filter.js"),
);
const skillsRefreshStateRuntimeLoader = createLazyImportLoader<SkillsRefreshStateRuntime>(
() => import("./skills/refresh-state.js"),
() => import("../skills/refresh-state.js"),
);
const skillsRemoteRuntimeLoader = createLazyImportLoader<SkillsRemoteRuntime>(
() => import("../infra/skills-remote.js"),

View File

@@ -21,6 +21,7 @@ import {
normalizeOptionalString,
resolvePrimaryStringValue,
} from "../shared/string-coerce.js";
import { resolveEffectiveAgentSkillFilter } from "../skills/agent-filter.js";
import { resolveUserPath } from "../utils.js";
import {
listAgentIds,
@@ -28,7 +29,6 @@ import {
resolveAgentWorkspaceDir,
resolveDefaultAgentId,
} from "./agent-scope-config.js";
import { resolveEffectiveAgentSkillFilter } from "./skills/agent-filter.js";
export {
listAgentEntries,
listAgentIds,

View File

@@ -31,6 +31,8 @@ import {
type PluginHookToolKind,
} from "../plugins/types.js";
import { createLazyRuntimeSurface } from "../shared/lazy-runtime.js";
import { resolveSkillTelemetrySource, resolveSkillTelemetrySourceValue } from "../skills/source.js";
import type { SkillSnapshot, SkillTelemetrySource } from "../skills/types.js";
import { isPlainObject } from "../utils.js";
import { adjustedParamsByToolCallId } from "./agent-tools.before-tool-call.state.js";
import { copyChannelAgentToolMeta, getChannelAgentToolMeta } from "./channel-tools.js";
@@ -42,8 +44,6 @@ import {
reconcileCodeModeExecBeforeHookParams,
} from "./code-mode-control-tools.js";
import type { SandboxFsBridge } from "./sandbox/fs-bridge.js";
import { resolveSkillTelemetrySource, resolveSkillTelemetrySourceValue } from "./skills/source.js";
import type { SkillSnapshot, SkillTelemetrySource } from "./skills/types.js";
import { normalizeToolName } from "./tool-policy.js";
import type { AnyAgentTool } from "./tools/common.js";
import { callGatewayTool } from "./tools/gateway.js";

View File

@@ -21,6 +21,7 @@ import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalLowercaseString,
} from "../shared/string-coerce.js";
import type { SkillSnapshot } from "../skills/types.js";
import { resolveGatewayMessageChannel } from "../utils/message-channel.js";
import { resolveAgentConfig } from "./agent-scope.js";
import { wrapToolWithAbortSignal } from "./agent-tools.abort.js";
@@ -70,7 +71,6 @@ import type { SandboxContext } from "./sandbox.js";
import { SANDBOX_AGENT_WORKSPACE_MOUNT } from "./sandbox/constants.js";
import { resolveSenderToolPolicy } from "./sender-tool-policy.js";
import { createCodingTools, createReadTool } from "./sessions/index.js";
import type { SkillSnapshot } from "./skills/types.js";
import {
isSubagentEnvelopeSession,
resolveSubagentCapabilityStore,

View File

@@ -3,7 +3,7 @@ import fs from "node:fs/promises";
import path from "node:path";
import { resolvePreferredOpenClawTmpDir } from "../../infra/tmp-openclaw-dir.js";
import { normalizeLowercaseStringOrEmpty } from "../../shared/string-coerce.js";
import type { SkillSnapshot } from "../skills.js";
import type { SkillSnapshot } from "../../skills/index.js";
import { cliBackendLog } from "./log.js";
const CLAUDE_CLI_BACKEND_ID = "claude-cli";

View File

@@ -11,6 +11,7 @@ import { requestHeartbeat as requestHeartbeatImpl } from "../../infra/heartbeat-
import { sanitizeHostExecEnv } from "../../infra/host-env-security.js";
import { enqueueSystemEvent as enqueueSystemEventImpl } from "../../infra/system-events.js";
import { getProcessSupervisor as getProcessSupervisorImpl } from "../../process/supervisor/index.js";
import { applySkillEnvOverridesFromSnapshot } from "../../skills/index.js";
import { appendBootstrapPromptWarning } from "../bootstrap-budget.js";
import {
createCliJsonlStreamingParser,
@@ -22,7 +23,6 @@ import { classifyFailoverReason } from "../embedded-agent-helpers.js";
import { sanitizeToolArgs, sanitizeToolResult } from "../embedded-agent-subscribe.tools.js";
import { FailoverError, resolveFailoverStatus } from "../failover-error.js";
import { applyPluginTextReplacements } from "../plugin-text-transforms.js";
import { applySkillEnvOverridesFromSnapshot } from "../skills.js";
import { runClaudeLiveSessionTurn, shouldUseClaudeLiveSession } from "./claude-live-session.js";
import { prepareClaudeCliSkillsPlugin } from "./claude-skills-plugin.js";
import {

View File

@@ -21,6 +21,7 @@ import { buildAgentHookContextChannelFields } from "../../plugins/hook-agent-con
import { getGlobalHookRunner } from "../../plugins/hook-runner-global.js";
import { annotateInterSessionPromptText } from "../../sessions/input-provenance.js";
import { uniqueStrings } from "../../shared/string-normalization.js";
import { resolveSkillsPromptForRun } from "../../skills/index.js";
import { resolveUserPath } from "../../utils.js";
import { resolveAgentDir, resolveSessionAgentIds } from "../agent-scope.js";
import { externalCliDiscoveryForProviderAuth } from "../auth-profiles/external-cli-discovery.js";
@@ -55,6 +56,7 @@ import { buildCurrentInboundPrompt } from "../embedded-agent-runner/run/runtime-
import { resolveHeartbeatPromptForSystemPrompt } from "../heartbeat-system-prompt.js";
import { applyPluginTextReplacements } from "../plugin-text-transforms.js";
import { resolveSkillsPromptForRun } from "../skills.js";
import { resolveSystemPromptOverride } from "../system-prompt-override.js";
import { buildSystemPromptReport } from "../system-prompt-report.js";
import { appendModelIdentitySystemPrompt } from "../system-prompt.js";
import { redactRunIdentifier, resolveRunWorkspaceDir } from "../workspace-run.js";

View File

@@ -14,6 +14,7 @@ import type {
PersistedUserTurnMessage,
UserTurnTranscriptRecorder,
} from "../../sessions/user-turn-transcript.js";
import type { SkillSnapshot } from "../../skills/index.js";
import type { BootstrapContextMode } from "../bootstrap-files.js";
import type { ResolvedCliBackend } from "../cli-backends.js";
import type { ContextWindowInfo } from "../context-window-guard.js";
@@ -22,7 +23,6 @@ import type {
CurrentInboundPromptContext,
EmbeddedRunTrigger,
} from "../embedded-agent-runner/run/params.js";
import type { SkillSnapshot } from "../skills.js";
import type { SilentReplyPromptMode } from "../system-prompt.types.js";
export type RunCliAgentParams = {

View File

@@ -19,6 +19,7 @@ import {
appendUserTurnTranscriptMessage,
type PersistedUserTurnMessage,
} from "../../sessions/user-turn-transcript.js";
import { buildWorkspaceSkillSnapshot } from "../../skills/index.js";
import { sanitizeForLog } from "../../terminal/ansi.js";
import { resolveMessageChannel } from "../../utils/message-channel.js";
import { resolveAuthProfileOrder } from "../auth-profiles/order.js";
@@ -36,7 +37,6 @@ import { resolveOpenAIRuntimeProvider } from "../openai-codex-routing.js";
import { buildAgentRuntimeAuthPlan } from "../runtime-plan/auth.js";
import type { AgentMessage } from "../runtime/index.js";
import { acquireSessionWriteLock, resolveSessionWriteLockOptions } from "../session-write-lock.js";
import { buildWorkspaceSkillSnapshot } from "../skills.js";
import { buildUsageWithNoCost } from "../stream-message-shared.js";
import {
buildClaudeCliFallbackContextPrelude,

View File

@@ -5,6 +5,7 @@ import { ensureContextEnginesInitialized as ensureContextEnginesInitializedImpl
import { resolveContextEngine as resolveContextEngineImpl } from "../../context-engine/registry.js";
import type { ContextEngine } from "../../context-engine/types.js";
import { createSubsystemLogger } from "../../logging/subsystem.js";
import type { SkillSnapshot } from "../../skills/index.js";
import { createPreparedEmbeddedAgentSettingsManager as createPreparedEmbeddedAgentSettingsManagerImpl } from "../agent-project-settings.js";
import { OPENCLAW_AGENT_RUNTIME_ID } from "../agent-runtime-id.js";
import { normalizeOptionalAgentRuntimeId } from "../agent-runtime-id.js";
@@ -27,7 +28,6 @@ import { ensureSelectedAgentHarnessPlugin as ensureSelectedAgentHarnessPluginImp
import { maybeCompactAgentHarnessSession as maybeCompactAgentHarnessSessionImpl } from "../harness/selection.js";
import type { AgentMessage } from "../runtime/index.js";
import { SessionManager } from "../sessions/index.js";
import type { SkillSnapshot } from "../skills.js";
import { recordCliCompactionInStore as recordCliCompactionInStoreImpl } from "./session-store.js";
type SessionManagerLike = ReturnType<typeof SessionManager.open>;

View File

@@ -755,7 +755,7 @@ export async function loadCompactHooksHarness(): Promise<{
limitHistoryTurns: vi.fn((msgs: unknown[]) => msgs.slice(0, 2)),
}));
vi.doMock("../skills.js", () => ({
vi.doMock("../../skills/index.js", () => ({
applySkillEnvOverrides: vi.fn(() => () => {}),
applySkillEnvOverridesFromSnapshot: vi.fn(() => () => {}),
loadWorkspaceSkillEntries: vi.fn(() => []),

View File

@@ -25,6 +25,11 @@ import {
transformProviderSystemPrompt,
} from "../../plugins/provider-runtime.js";
import { isCronSessionKey, isSubagentSessionKey } from "../../routing/session-key.js";
import {
applySkillEnvOverrides,
applySkillEnvOverridesFromSnapshot,
resolveSkillsPromptForRun,
} from "../../skills/index.js";
import { resolveUserPath } from "../../utils.js";
import { normalizeMessageChannel } from "../../utils/message-channel.js";
import { isReasoningTagProvider } from "../../utils/provider-utils.js";
@@ -106,6 +111,7 @@ import {
applySkillEnvOverridesFromSnapshot,
resolveSkillsPromptForRun,
} from "../skills.js";
import { resolveSystemPromptOverride } from "../system-prompt-override.js";
import { filterRuntimeCompatibleTools } from "../tool-schema-projection.js";
import { logRuntimeToolSchemaQuarantine } from "../tool-schema-quarantine.js";
import {

View File

@@ -3,9 +3,9 @@ import type { ReasoningLevel, ThinkLevel } from "../../auto-reply/thinking.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { ContextEngine, ContextEngineRuntimeContext } from "../../context-engine/types.js";
import type { CommandQueueEnqueueFn } from "../../process/command-queue.types.js";
import type { SkillSnapshot } from "../../skills/index.js";
import type { ExecElevatedDefaults, ExecToolDefaults } from "../bash-tools.exec-types.js";
import type { AgentRuntimePlan } from "../runtime-plan/types.js";
import type { SkillSnapshot } from "../skills.js";
export type CompactEmbeddedAgentSessionParams = {
sessionId: string;

View File

@@ -1,13 +1,13 @@
import type { SourceReplyDeliveryMode } from "../../auto-reply/get-reply-options.types.js";
import type { ReasoningLevel, ThinkLevel } from "../../auto-reply/thinking.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { SkillSnapshot } from "../../skills/index.js";
import {
listActiveProcessSessionReferences,
type ActiveProcessSessionReference,
} from "../bash-process-references.js";
import type { ExecElevatedDefaults } from "../bash-tools.js";
import { resolveSelectedOpenAIRuntimeProvider } from "../openai-codex-routing.js";
import type { SkillSnapshot } from "../skills.js";
export type EmbeddedCompactionRuntimeContext = {
sessionKey?: string;

View File

@@ -379,7 +379,7 @@ vi.mock("../../bootstrap-files.js", async () => {
};
});
vi.mock("../../skills.js", () => ({
vi.mock("../../../skills/index.js", () => ({
applySkillEnvOverrides: () => () => {},
applySkillEnvOverridesFromSnapshot: () => () => {},
resolveSkillsPromptForRun: (...args: unknown[]) => hoisted.resolveSkillsPromptForRunMock(...args),

View File

@@ -52,6 +52,11 @@ import { getPluginToolMeta } from "../../../plugins/tools.js";
import { isSubagentSessionKey } from "../../../routing/session-key.js";
import { annotateInterSessionPromptText } from "../../../sessions/input-provenance.js";
import { normalizeOptionalString } from "../../../shared/string-coerce.js";
import {
applySkillEnvOverrides,
applySkillEnvOverridesFromSnapshot,
resolveSkillsPromptForRun,
} from "../../../skills/index.js";
import {
buildTrajectoryArtifacts,
buildTrajectoryRunMetadata,
@@ -160,11 +165,6 @@ import { sanitizeToolUseResultPairing } from "../../session-transcript-repair.js
import { acquireSessionWriteLock } from "../../session-write-lock.js";
import { createAgentSession, SessionManager } from "../../sessions/index.js";
import { detectRuntimeShell } from "../../shell-utils.js";
import {
applySkillEnvOverrides,
applySkillEnvOverridesFromSnapshot,
resolveSkillsPromptForRun,
} from "../../skills.js";
import { buildActiveSubagentSystemPromptAddition } from "../../subagent-active-context.js";
import {
isSubagentEnvelopeSession,

View File

@@ -12,6 +12,7 @@ import type { PromptImageOrderEntry } from "../../../media/prompt-image-order.js
import type { CommandQueueEnqueueFn } from "../../../process/command-queue.types.js";
import type { InputProvenance } from "../../../sessions/input-provenance.js";
import type { UserTurnTranscriptRecorder } from "../../../sessions/user-turn-transcript.js";
import type { SkillSnapshot } from "../../../skills/index.js";
import type { ExecElevatedDefaults, ExecToolDefaults } from "../../bash-tools.exec-types.js";
import type { AgentStreamParams, ClientToolDefinition } from "../../command/shared-types.js";
import type { BlockReplyPayload } from "../../embedded-agent-payloads.js";
@@ -22,7 +23,6 @@ import type {
} from "../../embedded-agent-subscribe.shared-types.js";
import type { AgentInternalEvent } from "../../internal-events.js";
import type { AgentMessage } from "../../runtime/index.js";
import type { SkillSnapshot } from "../../skills.js";
import type { SilentReplyPromptMode } from "../../system-prompt.types.js";
import type { PromptMode } from "../../system-prompt.types.js";
import type { EmbeddedAgentExecutionPhase } from "../execution-phase.js";

View File

@@ -4,8 +4,8 @@ import {
setRuntimeConfigSnapshot,
type OpenClawConfig,
} from "../../config/config.js";
import * as skillsModule from "../skills.js";
import type { SkillSnapshot } from "../skills.js";
import * as skillsModule from "../../skills/index.js";
import type { SkillSnapshot } from "../../skills/index.js";
import { resolveEmbeddedRunSkillEntries } from "./skills-runtime.js";
describe("resolveEmbeddedRunSkillEntries", () => {

View File

@@ -1,6 +1,10 @@
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import { loadWorkspaceSkillEntries, type SkillEntry, type SkillSnapshot } from "../skills.js";
import { resolveSkillRuntimeConfig } from "../skills/runtime-config.js";
import {
loadWorkspaceSkillEntries,
type SkillEntry,
type SkillSnapshot,
} from "../../skills/index.js";
import { resolveSkillRuntimeConfig } from "../../skills/runtime-config.js";
export function resolveEmbeddedRunSkillEntries(params: {
workspaceDir: string;

View File

@@ -46,7 +46,7 @@ vi.mock("node:child_process", () => ({
},
}));
vi.mock("./skills.js", () => ({
vi.mock("../skills/index.js", () => ({
syncSkillsToWorkspace: vi.fn(async () => undefined),
}));

View File

@@ -41,7 +41,7 @@ vi.mock("./exec-defaults.js", () => ({
canExecRequestNode: vi.fn(() => false),
}));
vi.mock("./skills.js", () => ({
vi.mock("../skills/index.js", () => ({
syncSkillsToWorkspace: syncSkillsToWorkspaceMock,
}));

View File

@@ -57,7 +57,7 @@ async function ensureSandboxWorkspaceLayout(params: {
await Promise.all([
import("../../infra/skills-remote.js"),
import("../exec-defaults.js"),
import("../skills.js"),
import("../../skills/index.js"),
]);
await syncSkillsToWorkspace({
sourceWorkspaceDir: agentWorkspaceDir,

View File

@@ -12,11 +12,11 @@ import { fetchWithSsrFGuard } from "../infra/net/fetch-guard.js";
import { isWithinDir } from "../infra/path-safety.js";
import { createLazyImportLoader } from "../shared/lazy-promise.js";
import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";
import type { SkillEntry, SkillInstallSpec } from "../skills/index.js";
import { resolveSkillToolsRootDir } from "../skills/tools-dir.js";
import { ensureDir, resolveUserPath } from "../utils.js";
import { formatInstallFailureMessage } from "./skills-install-output.js";
import type { SkillInstallResult } from "./skills-install.types.js";
import type { SkillEntry, SkillInstallSpec } from "./skills.js";
import { resolveSkillToolsRootDir } from "./skills/tools-dir.js";
const extractModuleLoader = createLazyImportLoader(() => import("./skills-install-extract.js"));

View File

@@ -10,8 +10,8 @@ import {
import { formatErrorMessage } from "../infra/errors.js";
import { runCommandWithTimeout } from "../process/exec.js";
import { normalizeStringEntries } from "../shared/string-normalization.js";
import { hasBinary } from "../skills/index.js";
import { parseTarVerboseMetadata } from "./skills-install-tar-verbose.js";
import { hasBinary } from "./skills.js";
export type ArchiveExtractResult = { stdout: string; stderr: string; code: number | null };
type TarPreflightResult = {

View File

@@ -2,9 +2,9 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import type { SkillEntry, SkillInstallSpec } from "../skills/index.js";
import { captureEnv } from "../test-utils/env.js";
import { hasBinaryMock, runCommandWithTimeoutMock } from "./skills-install.test-mocks.js";
import type { SkillEntry, SkillInstallSpec } from "./skills.js";
const skillsMocks = vi.hoisted(() => ({
loadWorkspaceSkillEntries: vi.fn(),
@@ -18,8 +18,8 @@ vi.mock("../plugins/install-security-scan.js", () => ({
scanSkillInstallSource: vi.fn(async () => undefined),
}));
vi.mock("./skills.js", async (importOriginal) => {
const actual = await importOriginal<typeof import("./skills.js")>();
vi.mock("../skills/index.js", async (importOriginal) => {
const actual = await importOriginal<typeof import("../skills/index.js")>();
return {
...actual,
loadWorkspaceSkillEntries: skillsMocks.loadWorkspaceSkillEntries,

View File

@@ -3,6 +3,8 @@ import os from "node:os";
import path from "node:path";
import { Readable } from "node:stream";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { resolveSkillToolsRootDir } from "../skills/tools-dir.js";
import type { SkillEntry, SkillInstallSpec } from "../skills/types.js";
import { installDownloadSpec } from "./skills-install-download.js";
import { setTempStateDir } from "./skills-install.download-test-utils.js";
import {
@@ -11,8 +13,6 @@ import {
runCommandWithTimeoutMock,
} from "./skills-install.test-mocks.js";
import { createCanonicalFixtureSkill } from "./skills.test-helpers.js";
import { resolveSkillToolsRootDir } from "./skills/tools-dir.js";
import type { SkillEntry, SkillInstallSpec } from "./skills/types.js";
vi.mock("../process/exec.js", () => ({
runCommandWithTimeout: (...args: unknown[]) => runCommandWithTimeoutMock(...args),
@@ -22,7 +22,7 @@ vi.mock("../infra/net/fetch-guard.js", () => ({
fetchWithSsrFGuard: (...args: unknown[]) => fetchWithSsrFGuardMock(...args),
}));
vi.mock("./skills.js", () => ({
vi.mock("../skills/index.js", () => ({
hasBinary: (bin: string) => hasBinaryMock(bin),
}));

View File

@@ -6,6 +6,9 @@ import {
resetGlobalHookRunner,
} from "../plugins/hook-runner-global.js";
import { createMockPluginRegistry } from "../plugins/hooks.test-helpers.js";
import { resolveOpenClawMetadata, resolveSkillInvocationPolicy } from "../skills/frontmatter.js";
import { loadSkillsFromDirSafe, readSkillFrontmatterSafe } from "../skills/local-loader.js";
import type { SkillEntry } from "../skills/types.js";
import { captureEnv } from "../test-utils/env.js";
import { createFixtureSuite } from "../test-utils/fixture-suite.js";
import { installSkill, testing as skillsInstallTesting } from "./skills-install.js";
@@ -13,9 +16,6 @@ import {
runCommandWithTimeoutMock,
scanDirectoryWithSummaryMock,
} from "./skills-install.test-mocks.js";
import { resolveOpenClawMetadata, resolveSkillInvocationPolicy } from "./skills/frontmatter.js";
import { loadSkillsFromDirSafe, readSkillFrontmatterSafe } from "./skills/local-loader.js";
import type { SkillEntry } from "./skills/types.js";
vi.mock("../process/exec.js", () => ({
runCommandWithTimeout: (...args: unknown[]) => runCommandWithTimeoutMock(...args),
@@ -25,7 +25,7 @@ vi.mock("../security/skill-scanner.js", () => ({
scanDirectoryWithSummary: (...args: unknown[]) => scanDirectoryWithSummaryMock(...args),
}));
vi.mock("./skills/plugin-skills.js", () => ({
vi.mock("../skills/plugin-skills.js", () => ({
resolvePluginSkillDirs: () => [],
}));

View File

@@ -11,10 +11,6 @@ import {
type SkillInstallSpecMetadata,
} from "../plugins/install-security-scan.js";
import { runCommandWithTimeout, type CommandOptions } from "../process/exec.js";
import { resolveUserPath } from "../utils.js";
import { installDownloadSpec } from "./skills-install-download.js";
import { formatInstallFailureMessage } from "./skills-install-output.js";
import type { SkillInstallResult } from "./skills-install.types.js";
import {
hasBinary as defaultHasBinary,
loadWorkspaceSkillEntries as defaultLoadWorkspaceSkillEntries,
@@ -22,8 +18,12 @@ import {
type SkillEntry,
type SkillInstallSpec,
type SkillsInstallPreferences,
} from "./skills.js";
import { resolveSkillSource } from "./skills/source.js";
} from "../skills/index.js";
import { resolveSkillSource } from "../skills/source.js";
import { resolveUserPath } from "../utils.js";
import { installDownloadSpec } from "./skills-install-download.js";
import { formatInstallFailureMessage } from "./skills-install-output.js";
import type { SkillInstallResult } from "./skills-install.types.js";
export type SkillInstallRequest = InstallSafetyOverrides & {
workspaceDir: string;

View File

@@ -7,11 +7,11 @@ import { writeJson } from "../infra/json-files.js";
import { parseGitPluginSpec } from "../plugins/git-install.js";
import { runCommandWithTimeout } from "../process/exec.js";
import { normalizeOptionalString } from "../shared/string-coerce.js";
import { parseFrontmatter } from "../skills/frontmatter.js";
import { sanitizeForLog } from "../terminal/ansi.js";
import { resolveUserPath } from "../utils.js";
import { installExtractedSkillRoot, validateRequestedSkillSlug } from "./skills-archive-install.js";
import { untrackClawHubSkill } from "./skills-clawhub.js";
import { parseFrontmatter } from "./skills/frontmatter.js";
type Logger = {
info?: (message: string) => void;

View File

@@ -2,10 +2,10 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import type { SkillEntry } from "../skills/types.js";
import { readLocalSkillCardContentSync } from "./skills-clawhub.js";
import { buildWorkspaceSkillStatus } from "./skills-status.js";
import { createCanonicalFixtureSkill } from "./skills.test-helpers.js";
import type { SkillEntry } from "./skills/types.js";
type SkillStatus = ReturnType<typeof buildWorkspaceSkillStatus>["skills"][number];

View File

@@ -2,15 +2,8 @@ import path from "node:path";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { evaluateEntryRequirementsForCurrentPlatform } from "../shared/entry-status.js";
import type { RequirementConfigCheck, Requirements } from "../shared/requirements.js";
import { CONFIG_DIR } from "../utils.js";
import {
readClawHubSkillsLockfileStatusSync,
resolveClawHubSkillStatusLinkSync,
resolveLocalSkillCardStatusSync,
type ClawHubSkillStatusLink,
type ClawHubSkillsLockfileStatusRead,
type LocalSkillCardStatus,
} from "./skills-clawhub.js";
import { resolveEffectiveAgentSkillFilter } from "../skills/agent-filter.js";
import { resolveBundledSkillsContext } from "../skills/bundled-context.js";
import {
hasBinary,
isBundledSkillAllowed,
@@ -23,10 +16,17 @@ import {
type SkillEligibilityContext,
type SkillInstallSpec,
type SkillsInstallPreferences,
} from "./skills.js";
import { resolveEffectiveAgentSkillFilter } from "./skills/agent-filter.js";
import { resolveBundledSkillsContext } from "./skills/bundled-context.js";
import { resolveSkillSource } from "./skills/source.js";
} from "../skills/index.js";
import { resolveSkillSource } from "../skills/source.js";
import { CONFIG_DIR } from "../utils.js";
import {
readClawHubSkillsLockfileStatusSync,
resolveClawHubSkillStatusLinkSync,
resolveLocalSkillCardStatusSync,
type ClawHubSkillStatusLink,
type ClawHubSkillsLockfileStatusRead,
type LocalSkillCardStatus,
} from "./skills-clawhub.js";
export type SkillStatusConfigCheck = RequirementConfigCheck;

View File

@@ -2,15 +2,15 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { writeSkill } from "./skills.test-helpers.js";
import {
restoreMockSkillsHomeEnv,
setMockSkillsHomeEnv,
type SkillsHomeEnvSnapshot,
} from "./skills/home-env.test-support.js";
import { buildWorkspaceSkillsPrompt } from "./skills/workspace.js";
} from "../skills/home-env.test-support.js";
import { buildWorkspaceSkillsPrompt } from "../skills/workspace.js";
import { writeSkill } from "./skills.test-helpers.js";
vi.mock("./skills/plugin-skills.js", () => ({
vi.mock("../skills/plugin-skills.js", () => ({
resolvePluginSkillDirs: () => [],
}));

View File

@@ -2,9 +2,9 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { buildWorkspaceSkillsPrompt } from "../skills/workspace.js";
import { captureEnv } from "../test-utils/env.js";
import { writeSkill } from "./skills.e2e-test-helpers.js";
import { buildWorkspaceSkillsPrompt } from "./skills/workspace.js";
describe("buildWorkspaceSkillsPrompt", () => {
it("applies bundled allowlist without affecting workspace skills", async () => {

View File

@@ -1,13 +1,13 @@
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { createSyntheticSourceInfo } from "../skills/skill-contract.js";
import type { OpenClawSkillMetadata, SkillEntry } from "../skills/types.js";
import { buildWorkspaceSkillsPrompt } from "../skills/workspace.js";
import { withEnv } from "../test-utils/env.js";
import { createFixtureSuite } from "../test-utils/fixture-suite.js";
import { writeSkill } from "./skills.e2e-test-helpers.js";
import { createSyntheticSourceInfo } from "./skills/skill-contract.js";
import type { OpenClawSkillMetadata, SkillEntry } from "./skills/types.js";
import { buildWorkspaceSkillsPrompt } from "./skills/workspace.js";
vi.mock("./skills/plugin-skills.js", () => ({
vi.mock("../skills/plugin-skills.js", () => ({
resolvePluginSkillDirs: () => [],
}));

View File

@@ -2,11 +2,11 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { buildWorkspaceSkillsPrompt, syncSkillsToWorkspace } from "../skills/workspace.js";
import { withEnv, withEnvAsync } from "../test-utils/env.js";
import { writeSkill } from "./skills.e2e-test-helpers.js";
import { buildWorkspaceSkillsPrompt, syncSkillsToWorkspace } from "./skills/workspace.js";
vi.mock("./skills/plugin-skills.js", () => ({
vi.mock("../skills/plugin-skills.js", () => ({
resolvePluginSkillDirs: () => [],
}));

View File

@@ -1,18 +1,18 @@
import fs from "node:fs/promises";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { withPathResolutionEnv } from "../test-utils/env.js";
import { createFixtureSuite } from "../test-utils/fixture-suite.js";
import { createTempHomeEnv, type TempHomeEnv } from "../test-utils/temp-home.js";
import { writeSkill, writeWorkspaceSkills } from "./skills.e2e-test-helpers.js";
import {
restoreMockSkillsHomeEnv,
setMockSkillsHomeEnv,
type SkillsHomeEnvSnapshot,
} from "./skills/home-env.test-support.js";
import { buildWorkspaceSkillSnapshot, buildWorkspaceSkillsPrompt } from "./skills/workspace.js";
} from "../skills/home-env.test-support.js";
import { buildWorkspaceSkillSnapshot, buildWorkspaceSkillsPrompt } from "../skills/workspace.js";
import { withPathResolutionEnv } from "../test-utils/env.js";
import { createFixtureSuite } from "../test-utils/fixture-suite.js";
import { createTempHomeEnv, type TempHomeEnv } from "../test-utils/temp-home.js";
import { writeSkill, writeWorkspaceSkills } from "./skills.e2e-test-helpers.js";
vi.mock("./skills/plugin-skills.js", () => ({
vi.mock("../skills/plugin-skills.js", () => ({
resolvePluginSkillDirs: () => [],
}));

View File

@@ -2,12 +2,12 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import type { SkillEntry } from "../skills/types.js";
import { loadWorkspaceSkillEntries } from "../skills/workspace.js";
import { withEnv, withEnvAsync } from "../test-utils/env.js";
import { buildWorkspaceSkillStatus } from "./skills-status.js";
import { writeSkill } from "./skills.e2e-test-helpers.js";
import { createCanonicalFixtureSkill } from "./skills.test-helpers.js";
import type { SkillEntry } from "./skills/types.js";
import { loadWorkspaceSkillEntries } from "./skills/workspace.js";
const tempDirs: string[] = [];

View File

@@ -2,7 +2,7 @@ import fs from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
import { parseFrontmatter } from "./skills/frontmatter.js";
import { parseFrontmatter } from "../skills/frontmatter.js";
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");

View File

@@ -1,11 +1,11 @@
import os from "node:os";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { createCanonicalFixtureSkill } from "./skills.test-helpers.js";
import {
testing as workspaceSkillsTesting,
buildWorkspaceSkillsPrompt,
} from "./skills/workspace.js";
} from "../skills/workspace.js";
import { createCanonicalFixtureSkill } from "./skills.test-helpers.js";
describe("compactSkillPaths", () => {
function buildPromptForFixtureSkill(params: {

View File

@@ -13,14 +13,14 @@ import {
import { resolveInstalledPluginIndexPolicyHash } from "../plugins/installed-plugin-index-policy.js";
import type { PluginManifestRecord, PluginManifestRegistry } from "../plugins/manifest-registry.js";
import type { PluginMetadataSnapshot } from "../plugins/plugin-metadata-snapshot.js";
import { writeSkill, writeWorkspaceSkills } from "./skills.e2e-test-helpers.js";
import {
restoreMockSkillsHomeEnv,
setMockSkillsHomeEnv,
type SkillsHomeEnvSnapshot,
} from "./skills/home-env.test-support.js";
import { readSkillFrontmatterSafe } from "./skills/local-loader.js";
import { loadWorkspaceSkillEntries } from "./skills/workspace.js";
} from "../skills/home-env.test-support.js";
import { readSkillFrontmatterSafe } from "../skills/local-loader.js";
import { loadWorkspaceSkillEntries } from "../skills/workspace.js";
import { writeSkill, writeWorkspaceSkills } from "./skills.e2e-test-helpers.js";
import { writePluginWithSkill } from "./test-helpers/skill-plugin-fixtures.js";
vi.mock("../plugins/manifest-registry.js", async () => {

View File

@@ -3,13 +3,13 @@ import fsPromises from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it, vi } from "vitest";
import { buildWorkspaceSkillsPrompt, syncSkillsToWorkspace } from "../skills/workspace.js";
import { writeSkill } from "./skills.e2e-test-helpers.js";
import { buildWorkspaceSkillsPrompt, syncSkillsToWorkspace } from "./skills/workspace.js";
// Mock resolvePluginSkillDirs to return our test plugin skill directories
const mockResolvePluginSkillDirs = vi.hoisted(() => vi.fn(() => [] as string[]));
vi.mock("./skills/plugin-skills.js", () => ({
vi.mock("../skills/plugin-skills.js", () => ({
resolvePluginSkillDirs: mockResolvePluginSkillDirs,
}));

View File

@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import type { SkillEntry } from "../skills/types.js";
import { resolveSkillsPromptForRun } from "../skills/workspace.js";
import { createCanonicalFixtureSkill } from "./skills.test-helpers.js";
import type { SkillEntry } from "./skills/types.js";
import { resolveSkillsPromptForRun } from "./skills/workspace.js";
describe("resolveSkillsPromptForRun", () => {
it("prefers snapshot prompt when available", () => {

View File

@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { parseFrontmatter } from "./skills/frontmatter.js";
import { parseFrontmatter } from "../skills/frontmatter.js";
describe("skills/summarize frontmatter", () => {
it("mentions podcasts, local files, and transcription use cases", () => {

View File

@@ -1,6 +1,6 @@
import fs from "node:fs/promises";
import path from "node:path";
import { createSyntheticSourceInfo, type Skill } from "./skills/skill-contract.js";
import { createSyntheticSourceInfo, type Skill } from "../skills/skill-contract.js";
export async function writeSkill(params: {
dir: string;

View File

@@ -7,25 +7,25 @@ import {
} from "../config/runtime-snapshot.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { clearPluginMetadataLifecycleCaches } from "../plugins/plugin-metadata-lifecycle.js";
import { buildWorkspaceSkillCommandSpecs } from "../skills/command-specs.js";
import { captureEnv, withPathResolutionEnv } from "../test-utils/env.js";
import { createFixtureSuite } from "../test-utils/fixture-suite.js";
import { createTempHomeEnv, type TempHomeEnv } from "../test-utils/temp-home.js";
import { writeSkill } from "./skills.e2e-test-helpers.js";
import { buildWorkspaceSkillCommandSpecs } from "./skills/command-specs.js";
import {
applySkillEnvOverrides,
applySkillEnvOverridesFromSnapshot,
getActiveSkillEnvKeys,
} from "./skills/env-overrides.js";
} from "../skills/env-overrides.js";
import {
restoreMockSkillsHomeEnv,
setMockSkillsHomeEnv,
type SkillsHomeEnvSnapshot,
} from "./skills/home-env.test-support.js";
import type { SkillEntry, SkillSnapshot } from "./skills/types.js";
import { buildWorkspaceSkillsPrompt } from "./skills/workspace.js";
} from "../skills/home-env.test-support.js";
import type { SkillEntry, SkillSnapshot } from "../skills/types.js";
import { buildWorkspaceSkillsPrompt } from "../skills/workspace.js";
vi.mock("./skills/plugin-skills.js", () => ({
vi.mock("../skills/plugin-skills.js", () => ({
resolvePluginSkillDirs: () => [],
}));

View File

@@ -1,51 +1 @@
import type { OpenClawConfig } from "../config/types.openclaw.js";
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalString,
} from "../shared/string-coerce.js";
import type { SkillsInstallPreferences } from "./skills/types.js";
export {
hasBinary,
isBundledSkillAllowed,
isConfigPathTruthy,
resolveBundledAllowlist,
resolveConfigPath,
resolveRuntimePlatform,
resolveSkillConfig,
} from "./skills/config.js";
export {
applySkillEnvOverrides,
applySkillEnvOverridesFromSnapshot,
} from "./skills/env-overrides.js";
export type {
OpenClawSkillMetadata,
SkillEligibilityContext,
SkillCommandSpec,
SkillEntry,
SkillInstallSpec,
SkillSnapshot,
SkillTelemetrySource,
SkillsInstallPreferences,
} from "./skills/types.js";
export {
buildWorkspaceSkillSnapshot,
buildWorkspaceSkillsPrompt,
filterWorkspaceSkillEntries,
filterWorkspaceSkillEntriesWithOptions,
loadWorkspaceSkillEntries,
resolveSkillsPromptForRun,
syncSkillsToWorkspace,
} from "./skills/workspace.js";
export { buildWorkspaceSkillCommandSpecs } from "./skills/command-specs.js";
export function resolveSkillsInstallPreferences(config?: OpenClawConfig): SkillsInstallPreferences {
const raw = config?.skills?.install;
const preferBrew = raw?.preferBrew ?? true;
const manager = normalizeLowercaseStringOrEmpty(normalizeOptionalString(raw?.nodeManager));
const nodeManager: SkillsInstallPreferences["nodeManager"] =
manager === "pnpm" || manager === "yarn" || manager === "bun" || manager === "npm"
? manager
: "npm";
return { preferBrew, nodeManager };
}
export * from "../skills/index.js";

View File

@@ -1,4 +1,3 @@
import type { SkillCommandSpec } from "../agents/skills.js";
import { getChannelPlugin } from "../channels/plugins/index.js";
import { isCommandFlagEnabled } from "../config/commands.flags.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
@@ -8,6 +7,7 @@ import {
normalizeOptionalLowercaseString,
normalizeOptionalString,
} from "../shared/string-coerce.js";
import type { SkillCommandSpec } from "../skills/index.js";
import {
listChatCommands,
listChatCommandsForConfig,

View File

@@ -1,6 +1,6 @@
import type { SkillCommandSpec } from "../agents/skills/types.js";
import { isCommandFlagEnabled } from "../config/commands.flags.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { SkillCommandSpec } from "../skills/types.js";
import { getChatCommands } from "./commands-registry.data.js";
import type { ChatCommandDefinition } from "./commands-registry.types.js";

View File

@@ -3,10 +3,10 @@ import {
buildConfiguredModelCatalog,
resolveConfiguredModelRef,
} from "../agents/model-selection.js";
import type { SkillCommandSpec } from "../agents/skills.js";
import { getChannelPlugin, getLoadedChannelPlugin } from "../channels/plugins/index.js";
import type { OpenClawConfig } from "../config/types.js";
import { normalizeOptionalLowercaseString } from "../shared/string-coerce.js";
import type { SkillCommandSpec } from "../skills/index.js";
import { listChatCommands, listChatCommandsForConfig } from "./commands-registry-list.js";
import { normalizeCommandBody } from "./commands-registry-normalize.js";
import { getChatCommands } from "./commands-registry.data.js";

View File

@@ -1,6 +1,5 @@
import { afterEach, beforeEach, vi } from "vitest";
import { clearRuntimeAuthProfileStoreSnapshots } from "../agents/auth-profiles.js";
import { resetSkillsRefreshForTest } from "../agents/skills/refresh.js";
import { clearSessionStoreCacheForTest } from "../config/sessions.js";
import { resetSystemEventsForTest } from "../infra/system-events.js";
import { createEmptyPluginRegistry } from "../plugins/registry-empty.js";
@@ -8,6 +7,7 @@ import type { PluginProviderRegistration } from "../plugins/registry.js";
import { resetPluginRuntimeStateForTest, setActivePluginRegistry } from "../plugins/runtime.js";
import type { ProviderPlugin } from "../plugins/types.js";
import { normalizeLowercaseStringOrEmpty } from "../shared/string-coerce.js";
import { resetSkillsRefreshForTest } from "../skills/refresh.js";
import {
clearSessionAuthProfileOverrideMock,
compactEmbeddedAgentSessionMock,

View File

@@ -22,11 +22,11 @@ vi.mock("../../agents/sandbox.js", () => ({
resolveSandboxRuntimeStatus: vi.fn(() => ({ sandboxed: false, mode: "off" })),
}));
vi.mock("../../agents/skills.js", () => ({
vi.mock("../../skills/index.js", () => ({
buildWorkspaceSkillSnapshot: vi.fn(() => ({ prompt: "", skills: [], resolvedSkills: [] })),
}));
vi.mock("../../agents/skills/refresh.js", () => ({
vi.mock("../../skills/refresh.js", () => ({
getSkillsSnapshotVersion: vi.fn(() => "test-snapshot"),
}));

View File

@@ -9,13 +9,13 @@ import { resolveDefaultModelForAgent } from "../../agents/model-selection.js";
import { resolveAgentPromptSurfaceForSessionKey } from "../../agents/prompt-surface.js";
import type { AgentTool } from "../../agents/runtime/index.js";
import { resolveSandboxRuntimeStatus } from "../../agents/sandbox.js";
import { buildWorkspaceSkillSnapshot } from "../../agents/skills.js";
import { getSkillsSnapshotVersion } from "../../agents/skills/refresh-state.js";
import { buildConfiguredAgentSystemPrompt } from "../../agents/system-prompt-config.js";
import { buildSystemPromptParams } from "../../agents/system-prompt-params.js";
import type { WorkspaceBootstrapFile } from "../../agents/workspace.js";
import { getRemoteSkillEligibility } from "../../infra/skills-remote.js";
import { listRegisteredPluginAgentPromptGuidance } from "../../plugins/command-registry-state.js";
import { buildWorkspaceSkillSnapshot } from "../../skills/index.js";
import { getSkillsSnapshotVersion } from "../../skills/refresh-state.js";
import type { HandleCommandsParams } from "./commands-types.js";
import { resolveRuntimePolicySessionKey } from "./runtime-policy-session-key.js";

View File

@@ -1,8 +1,8 @@
import type { BlockReplyChunking } from "../../agents/embedded-agent-block-chunker.js";
import type { SkillCommandSpec } from "../../agents/skills.js";
import type { ChannelId } from "../../channels/plugins/types.public.js";
import type { SessionEntry, SessionScope } from "../../config/sessions.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { SkillCommandSpec } from "../../skills/index.js";
import type { MsgContext } from "../templating.js";
import type { ElevatedLevel, ReasoningLevel, ThinkLevel, VerboseLevel } from "../thinking.js";
import type { GetReplyOptions, ReplyPayload } from "../types.js";

View File

@@ -1,9 +1,9 @@
import type { SkillCommandSpec } from "../../agents/skills.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalString,
} from "../../shared/string-coerce.js";
import type { SkillCommandSpec } from "../../skills/index.js";
export function reserveSkillCommandNames(params: {
reservedCommands: Set<string>;

View File

@@ -3,7 +3,6 @@ import { DEFAULT_CONTEXT_TOKENS } from "../../agents/defaults.js";
import { resolveFastModeState } from "../../agents/fast-mode.js";
import { type ModelAliasIndex, resolveModelRefFromString } from "../../agents/model-selection.js";
import { resolveSandboxRuntimeStatus } from "../../agents/sandbox/runtime-status.js";
import type { SkillCommandSpec } from "../../agents/skills.js";
import type { SessionEntry } from "../../config/sessions.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import { normalizeAgentId } from "../../routing/session-key.js";
@@ -12,6 +11,7 @@ import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalString,
} from "../../shared/string-coerce.js";
import type { SkillCommandSpec } from "../../skills/index.js";
import { shouldHandleTextCommands } from "../commands-text-routing.js";
import type { MsgContext, TemplateContext } from "../templating.js";
import {

View File

@@ -2,9 +2,9 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { SkillCommandSpec } from "../../agents/skills.js";
import type { SessionEntry } from "../../config/sessions.js";
import { getReplyPayloadMetadata } from "../reply-payload.js";
import type { SkillCommandSpec } from "../../skills/index.js";
import type { TemplateContext } from "../templating.js";
import { clearInlineDirectives } from "./get-reply-directives-utils.js";
import { handleInlineActions } from "./get-reply-inline-actions.js";

View File

@@ -1,6 +1,5 @@
import { collectTextContentBlocks } from "../../agents/content-blocks.js";
import type { BlockReplyChunking } from "../../agents/embedded-agent-block-chunker.js";
import type { SkillCommandSpec } from "../../agents/skills.js";
import { getChannelPlugin } from "../../channels/plugins/index.js";
import type { SessionEntry } from "../../config/sessions.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
@@ -13,6 +12,7 @@ import {
normalizeOptionalString,
} from "../../shared/string-coerce.js";
import { markReplyPayloadForSourceSuppressionDelivery } from "../reply-payload.js";
import type { SkillCommandSpec } from "../../skills/index.js";
import {
listReservedChatSlashCommandNames,
resolveSkillCommandInvocation,

View File

@@ -3,10 +3,10 @@ import {
resolveThinkingDefaultWithRuntimeCatalog,
type ModelAliasIndex,
} from "../../agents/model-selection.js";
import type { SkillCommandSpec } from "../../agents/skills.js";
import type { OpenClawConfig } from "../../config/config.js";
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
import { normalizeOptionalString } from "../../shared/string-coerce.js";
import type { SkillCommandSpec } from "../../skills/index.js";
import { isNativeCommandTurn, resolveCommandTurnContext } from "../command-turn-context.js";
import type { GetReplyOptions } from "../get-reply-options.types.js";
import type { ReplyPayload } from "../reply-payload.js";

View File

@@ -1,7 +1,6 @@
import type { AutoFallbackPrimaryProbe } from "../../../agents/agent-scope.js";
import type { ExecToolDefaults } from "../../../agents/bash-tools.js";
import type { CurrentInboundPromptContext } from "../../../agents/embedded-agent-runner/run/params.js";
import type { SkillSnapshot } from "../../../agents/skills.js";
import type { SilentReplyPromptMode } from "../../../agents/system-prompt.types.js";
import type { InboundEventKind } from "../../../channels/inbound-event/kind.js";
import type { SessionEntry } from "../../../config/sessions.js";
@@ -9,6 +8,7 @@ import type { OpenClawConfig } from "../../../config/types.openclaw.js";
import type { PromptImageOrderEntry } from "../../../media/prompt-image-order.js";
import type { InputProvenance } from "../../../sessions/input-provenance.js";
import type { UserTurnTranscriptRecorder } from "../../../sessions/user-turn-transcript.js";
import type { SkillSnapshot } from "../../../skills/index.js";
import type {
QueuedReplyDeliveryCorrelation,
QueuedReplyLifecycle,

View File

@@ -53,15 +53,15 @@ vi.mock("../../agents/agent-scope.js", () => ({
resolveSessionAgentId: resolveSessionAgentIdMock,
}));
vi.mock("../../agents/skills.js", () => ({
vi.mock("../../skills/index.js", () => ({
buildWorkspaceSkillSnapshot: buildWorkspaceSkillSnapshotMock,
}));
vi.mock("../../agents/skills/refresh.js", () => ({
vi.mock("../../skills/refresh.js", () => ({
ensureSkillsWatcher: ensureSkillsWatcherMock,
}));
vi.mock("../../agents/skills/refresh-state.js", () => ({
vi.mock("../../skills/refresh-state.js", () => ({
getSkillsSnapshotVersion: getSkillsSnapshotVersionMock,
shouldRefreshSnapshotForVersion: shouldRefreshSnapshotForVersionMock,
}));

View File

@@ -2,14 +2,6 @@ import crypto from "node:crypto";
import path from "node:path";
import { resolveSessionAgentId } from "../../agents/agent-scope.js";
import { canExecRequestNode } from "../../agents/exec-defaults.js";
import { buildWorkspaceSkillSnapshot, type SkillSnapshot } from "../../agents/skills.js";
import { matchesSkillFilter } from "../../agents/skills/filter.js";
import {
getSkillsSnapshotVersion,
shouldRefreshSnapshotForVersion,
} from "../../agents/skills/refresh-state.js";
import { ensureSkillsWatcher } from "../../agents/skills/refresh.js";
import { hydrateResolvedSkills } from "../../agents/skills/snapshot-hydration.js";
import { stableStringify } from "../../agents/stable-stringify.js";
import {
canonicalizeAbsoluteSessionFilePath,
@@ -30,6 +22,14 @@ import { getRemoteSkillEligibility } from "../../infra/skills-remote.js";
import { getGlobalHookRunner } from "../../plugins/hook-runner-global.js";
import { resolveAgentIdFromSessionKey } from "../../routing/session-key.js";
import { normalizeOptionalString } from "../../shared/string-coerce.js";
import { matchesSkillFilter } from "../../skills/filter.js";
import { buildWorkspaceSkillSnapshot, type SkillSnapshot } from "../../skills/index.js";
import {
getSkillsSnapshotVersion,
shouldRefreshSnapshotForVersion,
} from "../../skills/refresh-state.js";
import { ensureSkillsWatcher } from "../../skills/refresh.js";
import { hydrateResolvedSkills } from "../../skills/snapshot-hydration.js";
import { buildSessionEndHookPayload, buildSessionStartHookPayload } from "./session-hooks.js";
export { drainFormattedSystemEvents } from "./session-system-events.js";

View File

@@ -8,7 +8,6 @@ import type { AnyAgentTool } from "../../agents/agent-tools.types.js";
import { createOpenClawTools } from "../../agents/openclaw-tools.runtime.js";
import { resolveSandboxRuntimeStatus } from "../../agents/sandbox/runtime-status.js";
import { resolveSenderToolPolicy } from "../../agents/sender-tool-policy.js";
import type { SkillCommandSpec } from "../../agents/skills.js";
import {
isSubagentEnvelopeSession,
resolveSubagentCapabilityStore,
@@ -29,6 +28,7 @@ import type { SessionEntry } from "../../config/sessions.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import { logVerbose } from "../../globals.js";
import { getPluginToolMeta } from "../../plugins/tools.js";
import type { SkillCommandSpec } from "../../skills/index.js";
import { resolveGatewayMessageChannel } from "../../utils/message-channel.js";
import type { MsgContext } from "../templating.js";
import { extractExplicitGroupId } from "./group-id.js";

View File

@@ -1,8 +1,8 @@
import type { SkillCommandSpec } from "../agents/skills.js";
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalLowercaseString,
} from "../shared/string-coerce.js";
import type { SkillCommandSpec } from "../skills/index.js";
import { getChatCommands } from "./commands-registry.data.js";
export function listReservedChatSlashCommandNames(extraNames: string[] = []): Set<string> {

View File

@@ -131,7 +131,7 @@ vi.mock("../infra/skills-remote.js", () => ({
getRemoteSkillEligibility: () => ({}),
}));
vi.mock("../agents/skills.js", () => ({
vi.mock("../skills/index.js", () => ({
buildWorkspaceSkillCommandSpecs,
}));

View File

@@ -5,7 +5,6 @@ import {
resolveAgentWorkspaceDir,
} from "../agents/agent-scope.js";
import { canExecRequestNode } from "../agents/exec-defaults.js";
import { buildWorkspaceSkillCommandSpecs, type SkillCommandSpec } from "../agents/skills.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { logVerbose } from "../globals.js";
import { getRemoteSkillEligibility } from "../infra/skills-remote.js";
@@ -14,6 +13,7 @@ import {
normalizeOptionalLowercaseString,
} from "../shared/string-coerce.js";
import { uniqueStrings } from "../shared/string-normalization.js";
import { buildWorkspaceSkillCommandSpecs, type SkillCommandSpec } from "../skills/index.js";
import { listReservedChatSlashCommandNames } from "./skill-commands-base.js";
export {
listReservedChatSlashCommandNames,

View File

@@ -3,8 +3,8 @@ import os from "node:os";
import path from "node:path";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { buildWorkspaceSkillStatus } from "../agents/skills-status.js";
import type { SkillEntry } from "../agents/skills.js";
import { createCanonicalFixtureSkill } from "../agents/skills.test-helpers.js";
import type { SkillEntry } from "../skills/index.js";
import { captureEnv } from "../test-utils/env.js";
import { formatSkillInfo, formatSkillsCheck, formatSkillsList } from "./skills-cli.format.js";

View File

@@ -240,21 +240,21 @@ vi.mock("../agents/workspace.js", () => ({
ensureAgentWorkspace: vi.fn(async ({ dir }: { dir: string }) => ({ dir })),
}));
vi.mock("../agents/skills.js", () => ({
vi.mock("../skills/index.js", () => ({
buildWorkspaceSkillSnapshot: vi.fn(() => undefined),
loadWorkspaceSkillEntries: vi.fn(() => []),
}));
vi.mock("../agents/skills/refresh.js", () => ({
vi.mock("../skills/refresh.js", () => ({
getSkillsSnapshotVersion: vi.fn(() => 0),
}));
vi.mock("../agents/skills/refresh-state.js", () => ({
vi.mock("../skills/refresh-state.js", () => ({
getSkillsSnapshotVersion: vi.fn(() => 0),
shouldRefreshSnapshotForVersion: vi.fn(() => false),
}));
vi.mock("../agents/skills/filter.js", () => ({
vi.mock("../skills/filter.js", () => ({
normalizeSkillFilter: vi.fn((skillFilter?: ReadonlyArray<unknown>) =>
skillFilter ? normalizeStringEntries(skillFilter) : undefined,
),

View File

@@ -1,6 +1,5 @@
import fs from "node:fs";
import path from "node:path";
import { resolveBundledSkillsDir } from "../agents/skills/bundled-dir.js";
import { resolveStateDir } from "../config/paths.js";
import { hydrateSessionStoreSkillPromptRefs } from "../config/sessions/skill-prompt-blobs.js";
import { resolveAllAgentSessionStoreTargetsSync } from "../config/sessions/targets.js";
@@ -8,6 +7,7 @@ import type { SessionEntry } from "../config/sessions/types.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { expandHomePrefix } from "../infra/home-dir.js";
import { isRecord } from "../shared/record-coerce.js";
import { resolveBundledSkillsDir } from "../skills/bundled-dir.js";
import { note } from "../terminal/note.js";
import { shortenHomePath } from "../utils.js";

View File

@@ -1,8 +1,8 @@
import { describe, expect, it } from "vitest";
import type { SkillStatusEntry, SkillStatusReport } from "../agents/skills-status.js";
import type { GhConfigDiscoveryInput } from "../agents/skills/gh-config-discovery.js";
import { createEmptyInstallChecks } from "../cli/requirements-test-fixtures.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { GhConfigDiscoveryInput } from "../skills/gh-config-discovery.js";
import {
collectUnavailableAgentSkills,
describeGhConfigDirHintFromDiscovery,

View File

@@ -2,14 +2,14 @@ import { existsSync } from "node:fs";
import { resolveAgentWorkspaceDir, resolveDefaultAgentId } from "../agents/agent-scope.js";
import type { SkillStatusEntry } from "../agents/skills-status.js";
import { buildWorkspaceSkillStatus } from "../agents/skills-status.js";
import { formatCliCommand } from "../cli/command-format.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import {
detectGhConfigDirMismatch,
formatGhConfigDirMismatchHint,
type GhConfigDiscoveryInput,
type GhConfigDiscoveryResult,
} from "../agents/skills/gh-config-discovery.js";
import { formatCliCommand } from "../cli/command-format.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
} from "../skills/gh-config-discovery.js";
import { note } from "../terminal/note.js";
import type { DoctorPrompter } from "./doctor-prompter.js";
import {

View File

@@ -4,11 +4,11 @@ import path from "node:path";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { resolveEmbeddedRunSkillEntries } from "../../agents/embedded-agent-runner/skills-runtime.js";
import { createCanonicalFixtureSkill } from "../../agents/skills.test-helpers.js";
import type { Skill } from "../../agents/skills/skill-contract.js";
import type { Skill } from "../../skills/skill-contract.js";
import {
hydrateResolvedSkills,
hydrateResolvedSkillsAsync,
} from "../../agents/skills/snapshot-hydration.js";
} from "../../skills/snapshot-hydration.js";
import { createSuiteTempRootTracker } from "../../test-helpers/temp-dir.js";
import type { SessionEntry, SessionSkillPromptRef, SessionSkillSnapshot } from "./types.js";

View File

@@ -1,9 +1,9 @@
import crypto from "node:crypto";
import type { Skill } from "../../agents/skills/skill-contract.js";
import type { ChatType } from "../../channels/chat-type.js";
import type { ChannelId } from "../../channels/plugins/channel-id.types.js";
import type { ChannelRouteRef } from "../../plugin-sdk/channel-route.js";
import { normalizeOptionalString } from "../../shared/string-coerce.js";
import type { Skill } from "../../skills/skill-contract.js";
import type { DeliveryContext } from "../../utils/delivery-context.types.js";
import type { TtsAutoMode } from "../types.tts.js";

View File

@@ -1,12 +1,12 @@
import { createHash } from "node:crypto";
import type { BootstrapContextMode } from "../../agents/bootstrap-files.js";
import { resolveCliRuntimeExecutionProvider } from "../../agents/model-runtime-aliases.js";
import type { SkillSnapshot } from "../../agents/skills.js";
import type { ThinkLevel, VerboseLevel } from "../../auto-reply/thinking.js";
import type { AgentDefaultsConfig } from "../../config/types.agent-defaults.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { SourceDeliveryPlan } from "../../infra/outbound/source-delivery-plan.js";
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
import type { SkillSnapshot } from "../../skills/index.js";
import type { CronAgentExecutionPhaseUpdate, CronJob } from "../types.js";
import {
resolveCronChannelOutputPolicy,

View File

@@ -1,8 +1,8 @@
import fs from "node:fs";
import type { LiveSessionModelSelection } from "../../agents/live-model-switch.js";
import type { SkillSnapshot } from "../../agents/skills.js";
import type { SessionEntry } from "../../config/sessions.js";
import { isCronSessionKey } from "../../sessions/session-key-utils.js";
import type { SkillSnapshot } from "../../skills/index.js";
import type { resolveCronSession } from "./session.js";
type MutableSessionStore = Record<string, SessionEntry>;

View File

@@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import type { SkillSnapshot } from "../../agents/skills.js";
import { createSourceDeliveryPlan } from "../../infra/outbound/source-delivery-plan.js";
import type { SkillSnapshot } from "../../skills/index.js";
import type { CronDeliveryMode } from "../types.js";
import type { MutableCronSession } from "./run-session-state.js";
import {

View File

@@ -2,7 +2,6 @@ import { retireSessionMcpRuntime } from "../../agents/agent-bundle-mcp-tools.js"
import { hasAnyAuthProfileStoreSource } from "../../agents/auth-profiles/source-check.js";
import { resolveAgentHarnessPolicy } from "../../agents/harness/selection.js";
import { listOpenAIAuthProfileProvidersForAgentRuntime } from "../../agents/openai-codex-routing.js";
import type { SkillSnapshot } from "../../agents/skills.js";
import { expandToolGroups, normalizeToolName } from "../../agents/tool-policy.js";
import type { ThinkLevel } from "../../auto-reply/thinking.js";
import type { CliDeps } from "../../cli/outbound-send-deps.js";
@@ -27,6 +26,7 @@ import { isCommandLaneTaskTimeoutError } from "../../process/command-queue.js";
import { CommandLane } from "../../process/lanes.js";
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
import { normalizeOptionalString } from "../../shared/string-coerce.js";
import type { SkillSnapshot } from "../../skills/index.js";
import {
hasExplicitCronDeliveryTarget,
resolveCronDeliveryPlan,

View File

@@ -1,5 +1,5 @@
export { canExecRequestNode } from "../../agents/exec-defaults.js";
export { resolveAgentSkillsFilter } from "../../agents/agent-scope.js";
export { buildWorkspaceSkillSnapshot } from "../../agents/skills.js";
export { getSkillsSnapshotVersion } from "../../agents/skills/refresh-state.js";
export { buildWorkspaceSkillSnapshot } from "../../skills/index.js";
export { getSkillsSnapshotVersion } from "../../skills/refresh-state.js";
export { getRemoteSkillEligibility } from "../../infra/skills-remote.js";

View File

@@ -1,7 +1,7 @@
import type { SkillSnapshot } from "../../agents/skills.js";
import { matchesSkillFilter } from "../../agents/skills/filter.js";
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import { createLazyImportLoader } from "../../shared/lazy-promise.js";
import { matchesSkillFilter } from "../../skills/filter.js";
import type { SkillSnapshot } from "../../skills/index.js";
const skillsSnapshotRuntimeLoader = createLazyImportLoader(
() => import("./skills-snapshot.runtime.js"),

View File

@@ -1,9 +1,5 @@
import chokidar from "chokidar";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import {
getSkillsSnapshotVersion,
resetSkillsRefreshStateForTest,
} from "../agents/skills/refresh-state.js";
import { listChannelPlugins } from "../channels/plugins/index.js";
import type { ChannelPlugin } from "../channels/plugins/types.js";
import type {
@@ -17,6 +13,10 @@ import {
resetPluginRuntimeStateForTest,
setActivePluginRegistry,
} from "../plugins/runtime.js";
import {
getSkillsSnapshotVersion,
resetSkillsRefreshStateForTest,
} from "../skills/refresh-state.js";
import { createTestRegistry } from "../test-utils/channel-plugins.js";
import {
buildGatewayReloadPlan,

View File

@@ -1,5 +1,4 @@
import chokidar from "chokidar";
import { bumpSkillsSnapshotVersion } from "../agents/skills/refresh-state.js";
import type { ConfigWriteNotification } from "../config/io.js";
import { formatConfigIssueLines } from "../config/issue-format.js";
import { resolveConfigWriteFollowUp } from "../config/runtime-snapshot.js";
@@ -9,6 +8,7 @@ import {
loadInstalledPluginIndexInstallRecords,
loadInstalledPluginIndexInstallRecordsSync,
} from "../plugins/installed-plugin-index-records.js";
import { bumpSkillsSnapshotVersion } from "../skills/refresh-state.js";
import { diffConfigPaths } from "./config-diff.js";
import {
buildGatewayReloadPlan,

View File

@@ -25,7 +25,6 @@ import {
} from "../../agents/skills-clawhub.js";
import { installSkill } from "../../agents/skills-install.js";
import { buildWorkspaceSkillStatus } from "../../agents/skills-status.js";
import { loadWorkspaceSkillEntries, type SkillEntry } from "../../agents/skills.js";
import { listAgentWorkspaceDirs } from "../../agents/workspace-dirs.js";
import { redactConfigObject } from "../../config/redact-snapshot.js";
import {
@@ -38,6 +37,7 @@ import { formatErrorMessage } from "../../infra/errors.js";
import { getRemoteSkillEligibility } from "../../infra/skills-remote.js";
import { normalizeAgentId } from "../../routing/session-key.js";
import { normalizeOptionalString } from "../../shared/string-coerce.js";
import { loadWorkspaceSkillEntries, type SkillEntry } from "../../skills/index.js";
import { updateSkillConfigEntry } from "./skills-config-mutations.js";
import { installUploadedSkillArchive, skillsUploadHandlers } from "./skills-upload.js";
import type { GatewayRequestContext, GatewayRequestHandlers } from "./types.js";

View File

@@ -130,10 +130,7 @@ export async function startGatewayEarlyRuntime(params: {
? () => {}
: await measureStartup(params.startupTrace, "runtime.early.skills-listener", async () => {
const [{ registerSkillsChangeListener }, { refreshRemoteBinsForConnectedNodes }] =
await Promise.all([
import("../agents/skills/refresh.js"),
import("../infra/skills-remote.js"),
]);
await Promise.all([import("../skills/refresh.js"), import("../infra/skills-remote.js")]);
return registerSkillsChangeListener((event) => {
if (event.reason === "remote-node") {
return;

View File

@@ -1,9 +1,9 @@
import fs from "node:fs";
import path from "node:path";
import { hasBinary } from "../agents/skills.js";
import { formatErrorMessage } from "../infra/errors.js";
import { resolveExecutable } from "../infra/executable-path.js";
import { runCommandWithTimeout, type SpawnResult } from "../process/exec.js";
import { hasBinary } from "../skills/index.js";
import { resolveUserPath } from "../utils.js";
import { normalizeServePath } from "./gmail.js";

View File

@@ -16,7 +16,7 @@ vi.mock("node:child_process", async () => {
);
});
vi.mock("../agents/skills.js", () => ({
vi.mock("../skills/index.js", () => ({
hasBinary: mocks.hasBinary,
}));

View File

@@ -6,10 +6,10 @@
*/
import { type ChildProcess, spawn } from "node:child_process";
import { hasBinary } from "../agents/skills.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { createSubsystemLogger } from "../logging/subsystem.js";
import { runCommandWithTimeout } from "../process/exec.js";
import { hasBinary } from "../skills/index.js";
import { ensureTailscaleEndpoint } from "./gmail-setup-utils.js";
import { isAddressInUseError } from "./gmail-watcher-errors.js";
import {

View File

@@ -3,9 +3,9 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { getSkillsSnapshotVersion, resetSkillsRefreshForTest } from "../agents/skills/refresh.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { NodeRegistry } from "../gateway/node-registry.js";
import { getSkillsSnapshotVersion, resetSkillsRefreshForTest } from "../skills/refresh.js";
import {
getRemoteSkillEligibility,
recordRemoteNodeBins,

View File

@@ -1,6 +1,3 @@
import { bumpSkillsSnapshotVersion } from "../agents/skills/refresh-state.js";
import type { SkillEligibilityContext, SkillEntry } from "../agents/skills/types.js";
import { loadWorkspaceSkillEntries } from "../agents/skills/workspace.js";
import { listAgentWorkspaceDirs } from "../agents/workspace-dirs.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { NodeRegistry } from "../gateway/node-registry.js";
@@ -10,6 +7,9 @@ import {
normalizeOptionalString,
} from "../shared/string-coerce.js";
import { normalizeStringEntries } from "../shared/string-normalization.js";
import { bumpSkillsSnapshotVersion } from "../skills/refresh-state.js";
import type { SkillEligibilityContext, SkillEntry } from "../skills/types.js";
import { loadWorkspaceSkillEntries } from "../skills/workspace.js";
import { listNodePairing, updatePairedNodeMetadata } from "./node-pairing.js";
type RemoteNodeRecord = {

View File

@@ -99,7 +99,7 @@ export {
resolveSkillCommandInvocation,
} from "../auto-reply/skill-commands.js";
export { getPluginCommandSpecs, listProviderPluginCommandSpecs } from "../plugins/command-specs.js";
export type { SkillCommandSpec } from "../agents/skills.js";
export type { SkillCommandSpec } from "../skills/index.js";
export {
buildModelsProviderData,
formatModelsAvailableHeader,

View File

@@ -4,4 +4,4 @@ export {
registerSkillsChangeListener,
shouldRefreshSnapshotForVersion,
type SkillsChangeEvent,
} from "../agents/skills/refresh-state.js";
} from "../skills/refresh-state.js";

View File

@@ -9,7 +9,7 @@ import {
} from "./audit-extra.async.js";
import * as skillScanner from "./skill-scanner.js";
vi.mock("../agents/skills.js", () => ({
vi.mock("../skills/index.js", () => ({
loadWorkspaceSkillEntries: (workspaceDir: string) => {
const sep = workspaceDir.includes("\\") ? "\\" : "/";
const baseDir = `${workspaceDir}${sep}skills${sep}evil-skill`;

View File

@@ -47,13 +47,13 @@ type ExecDockerRawFn = (
const DEFAULT_SANDBOX_BROWSER_DOCKER_PROBE_TIMEOUT_MS = 5000;
type CodeSafetySummaryCache = Map<string, Promise<unknown>>;
let skillsModulePromise: Promise<typeof import("../agents/skills.js")> | undefined;
let skillsModulePromise: Promise<typeof import("../skills/index.js")> | undefined;
let configModulePromise: Promise<typeof import("../config/config.js")> | undefined;
let agentScopeModulePromise: Promise<typeof import("../agents/agent-scope.js")> | undefined;
let agentWorkspaceDirsModulePromise:
| Promise<typeof import("../agents/workspace-dirs.js")>
| undefined;
let skillSourceModulePromise: Promise<typeof import("../agents/skills/source.js")> | undefined;
let skillSourceModulePromise: Promise<typeof import("../skills/source.js")> | undefined;
let sandboxDockerModulePromise: Promise<typeof import("../agents/sandbox/docker.js")> | undefined;
let sandboxConstantsModulePromise:
| Promise<typeof import("../agents/sandbox/constants.js")>
@@ -63,7 +63,7 @@ let auditFsModulePromise: Promise<typeof import("./audit-fs.js")> | undefined;
let skillScannerModulePromise: Promise<typeof import("./skill-scanner.js")> | undefined;
function loadSkillsModule() {
skillsModulePromise ??= import("../agents/skills.js");
skillsModulePromise ??= import("../skills/index.js");
return skillsModulePromise;
}
@@ -88,7 +88,7 @@ function loadAgentWorkspaceDirsModule() {
}
function loadSkillSourceModule() {
skillSourceModulePromise ??= import("../agents/skills/source.js");
skillSourceModulePromise ??= import("../skills/source.js");
return skillSourceModulePromise;
}

View File

@@ -1,5 +1,5 @@
import type { OpenClawConfig } from "../../config/types.js";
import { normalizeAgentId } from "../../routing/session-key.js";
import type { OpenClawConfig } from "../config/types.js";
import { normalizeAgentId } from "../routing/session-key.js";
import { normalizeSkillFilter } from "./filter.js";
type AgentSkillsLimits = {

View File

@@ -1,4 +1,4 @@
import { createSubsystemLogger } from "../../logging/subsystem.js";
import { createSubsystemLogger } from "../logging/subsystem.js";
import { resolveBundledSkillsDir, type BundledSkillsResolveOptions } from "./bundled-dir.js";
import { loadSkillsFromDirSafe } from "./local-loader.js";

View File

@@ -3,8 +3,8 @@ import os from "node:os";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { captureEnv } from "../../test-utils/env.js";
import { writeSkill } from "../skills.e2e-test-helpers.js";
import { captureEnv } from "../test-utils/env.js";
import { resolveBundledSkillsDir } from "./bundled-dir.js";
describe("resolveBundledSkillsDir", () => {

View File

@@ -1,7 +1,7 @@
import fs from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { resolveOpenClawPackageRootSync } from "../../infra/openclaw-root.js";
import { resolveOpenClawPackageRootSync } from "../infra/openclaw-root.js";
function looksLikeSkillsDir(dir: string): boolean {
try {

View File

@@ -1,10 +1,10 @@
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import { createSubsystemLogger } from "../../logging/subsystem.js";
import { loadEnabledClaudeBundleCommands } from "../../plugins/bundle-commands.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import { createSubsystemLogger } from "../logging/subsystem.js";
import { loadEnabledClaudeBundleCommands } from "../plugins/bundle-commands.js";
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalLowercaseString,
} from "../../shared/string-coerce.js";
} from "../shared/string-coerce.js";
import { resolveEffectiveAgentSkillFilter } from "./agent-filter.js";
import { resolveSkillTelemetrySource } from "./source.js";
import type { SkillEligibilityContext, SkillCommandSpec, SkillEntry } from "./types.js";

View File

@@ -1,7 +1,7 @@
import os from "node:os";
import { formatSkillsForPrompt as upstreamFormatSkillsForPrompt } from "openclaw/plugin-sdk/agent-sessions";
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../config/config.js";
import type { OpenClawConfig } from "../config/config.js";
import { createCanonicalFixtureSkill } from "../skills.test-helpers.js";
import {
restoreMockSkillsHomeEnv,

View File

@@ -1,13 +1,13 @@
import type { OpenClawConfig } from "../../config/types.openclaw.js";
import type { SkillConfig } from "../../config/types.skills.js";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { SkillConfig } from "../config/types.skills.js";
import {
evaluateRuntimeEligibility,
hasBinary,
isConfigPathTruthyWithDefaults,
resolveConfigPath,
resolveRuntimePlatform,
} from "../../shared/config-eval.js";
import { normalizeStringEntries } from "../../shared/string-normalization.js";
} from "../shared/config-eval.js";
import { normalizeStringEntries } from "../shared/string-normalization.js";
import { resolveSkillKey } from "./frontmatter.js";
import { resolveSkillSource } from "./source.js";
import type { SkillEligibilityContext, SkillEntry } from "./types.js";

Some files were not shown because too many files have changed in this diff Show More