Files
openclaw/scripts/control-ui-mock-skill-workshop.ts
T
Peter SteinbergerandGitHub cf8b57e7d0 feat(skills): scan session history for workshop ideas (#106766)
* feat: scan past sessions for skill proposals

* feat(ui): add progressive skill history scans

* fix(ui): keep skill history scans synchronized

* refactor: split skill history scan ownership

* style: fix mock helper formatting

* style: format skill history scan

* build: refresh skill history schema baselines

* build: refresh plugin SDK baseline after rebase

* perf(ui): keep startup request budget bounded

* fix(skills): satisfy history scan integration gates

* fix(ui): bound control ui startup chunks

* build: refresh plugin SDK API baseline

* build(ui): refresh self-learning translation memory

* refactor(ui): split skill workshop state

* fix(ci): refresh skill workshop gates

* fix(ci): satisfy skill history lint

* build: refresh plugin SDK baseline after main rebase
2026-07-13 16:15:50 -07:00

93 lines
2.8 KiB
TypeScript

export function buildSkillWorkshopMocks(baseTime: number) {
const hour = 60 * 60 * 1000;
const day = 24 * hour;
const proposals = [
{
id: "prop-release-tweets",
kind: "update",
status: "pending",
title: "Tighten release tweet drafting",
description: "Capture the changelog-to-tweet flow the agent keeps re-deriving.",
skillName: "release-tweets",
skillKey: "release-tweets",
createdAt: new Date(baseTime - 2 * hour).toISOString(),
updatedAt: new Date(baseTime - hour).toISOString(),
scanState: "clean",
},
{
id: "prop-crawler-etiquette",
kind: "create",
status: "pending",
title: "Add crawler etiquette skill",
description: "Rate limits and robots.txt handling learned during the docs sweep.",
skillName: "crawler-etiquette",
skillKey: "crawler-etiquette",
createdAt: new Date(baseTime - 3 * day).toISOString(),
updatedAt: new Date(baseTime - 2 * day).toISOString(),
scanState: "clean",
},
{
id: "prop-changelog-style",
kind: "update",
status: "applied",
title: "Changelog bullet style",
description: "One bullet per entry, no hard wraps.",
skillName: "changelog-style",
skillKey: "changelog-style",
createdAt: new Date(baseTime - 6 * day).toISOString(),
updatedAt: new Date(baseTime - 5 * day).toISOString(),
scanState: "clean",
},
];
return {
list: {
schema: "openclaw.skill-workshop.proposals-manifest.v1",
updatedAt: new Date(baseTime - hour).toISOString(),
proposals,
},
inspect: {
cases: proposals.map((proposal) => ({
match: { proposalId: proposal.id },
response: {
record: {
...proposal,
proposedVersion: "2",
target: { skillName: proposal.skillName, skillKey: proposal.skillKey },
},
content: [
`# ${proposal.title}`,
"",
proposal.description,
"",
"## Steps",
"1. Gather the source material.",
"2. Apply the documented workflow.",
].join("\n"),
supportFiles: [],
},
})),
},
historyStatus: {
schema: "openclaw.skill-workshop.history-scan.v1",
hasScanned: false,
reviewedSessions: 0,
ideasFound: 0,
hasMore: false,
lastScanReviewed: 0,
lastScanIdeas: 0,
},
historyScan: {
schema: "openclaw.skill-workshop.history-scan.v1",
hasScanned: true,
reviewedSessions: 34,
ideasFound: 2,
hasMore: true,
lastScanReviewed: 20,
lastScanIdeas: 2,
lastScanAt: new Date(baseTime).toISOString(),
oldestReviewedAt: new Date(baseTime - 25 * day).toISOString(),
newestReviewedAt: new Date(baseTime).toISOString(),
},
};
}