test: align skill fixture source info

This commit is contained in:
Peter Steinberger
2026-03-28 03:30:30 +00:00
parent ce7b3c94e0
commit 32fd469b2c
6 changed files with 34 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { installDownloadSpec } from "./skills-install-download.js";
import { setTempStateDir } from "./skills-install.download-test-utils.js";
@@ -79,7 +80,10 @@ function createFixtureSkill(params: {
description: params.description,
filePath: params.filePath,
baseDir: params.baseDir,
source: params.source,
sourceInfo: createSyntheticSourceInfo(params.filePath, {
source: params.source,
baseDir: params.baseDir,
}),
disableModelInvocation: false,
};
}

View File

@@ -1,3 +1,4 @@
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
import { describe, expect, it } from "vitest";
import { buildWorkspaceSkillStatus } from "./skills-status.js";
import type { SkillEntry } from "./skills/types.js";
@@ -53,7 +54,10 @@ function createFixtureSkill(params: {
description: params.description,
filePath: params.filePath,
baseDir: params.baseDir,
source: params.source,
sourceInfo: createSyntheticSourceInfo(params.filePath, {
source: params.source,
baseDir: params.baseDir,
}),
disableModelInvocation: false,
};
}

View File

@@ -1,6 +1,7 @@
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
import { afterEach, describe, expect, it } from "vitest";
import { withEnv, withEnvAsync } from "../test-utils/env.js";
import { buildWorkspaceSkillStatus } from "./skills-status.js";
@@ -62,7 +63,10 @@ function createFixtureSkill(params: {
description: params.description,
filePath: params.filePath,
baseDir: params.baseDir,
source: params.source,
sourceInfo: createSyntheticSourceInfo(params.filePath, {
source: params.source,
baseDir: params.baseDir,
}),
disableModelInvocation: false,
};
}

View File

@@ -1,3 +1,4 @@
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
import { describe, expect, it } from "vitest";
import { resolveSkillsPromptForRun } from "./skills.js";
import type { SkillEntry } from "./skills/types.js";
@@ -42,7 +43,10 @@ function createFixtureSkill(params: {
description: params.description,
filePath: params.filePath,
baseDir: params.baseDir,
source: params.source,
sourceInfo: createSyntheticSourceInfo(params.filePath, {
source: params.source,
baseDir: params.baseDir,
}),
disableModelInvocation: false,
};
}

View File

@@ -1,5 +1,9 @@
import os from "node:os";
import { formatSkillsForPrompt, type Skill } from "@mariozechner/pi-coding-agent";
import {
createSyntheticSourceInfo,
formatSkillsForPrompt,
type Skill,
} from "@mariozechner/pi-coding-agent";
import { describe, expect, it } from "vitest";
import type { OpenClawConfig } from "../../config/config.js";
import type { SkillEntry } from "./types.js";
@@ -15,7 +19,10 @@ function makeSkill(name: string, desc = "A skill", filePath = `/skills/${name}/S
description: desc,
filePath,
baseDir: `/skills/${name}`,
source: "workspace",
sourceInfo: createSyntheticSourceInfo(filePath, {
source: "workspace",
baseDir: `/skills/${name}`,
}),
disableModelInvocation: false,
};
}

View File

@@ -1,6 +1,7 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { createSyntheticSourceInfo } from "@mariozechner/pi-coding-agent";
import { afterAll, beforeAll, describe, expect, it } from "vitest";
import { buildWorkspaceSkillStatus } from "../agents/skills-status.js";
import type { SkillEntry } from "../agents/skills.js";
@@ -97,7 +98,10 @@ function createFixtureSkill(params: {
description: params.description,
filePath: params.filePath,
baseDir: params.baseDir,
source: params.source,
sourceInfo: createSyntheticSourceInfo(params.filePath, {
source: params.source,
baseDir: params.baseDir,
}),
disableModelInvocation: false,
};
}