refactor(session-history): move extraction scripts behind skills (#619)
Some checks failed
CI / pr-title (push) Has been cancelled
CI / test (push) Has been cancelled
Release PR / release-pr (push) Has been cancelled
Release PR / publish-cli (push) Has been cancelled

This commit is contained in:
Trevin Chow
2026-04-21 00:12:11 -07:00
committed by GitHub
parent e0f2a4f9d7
commit cd4af86e5e
9 changed files with 153 additions and 32 deletions

View File

@@ -1,18 +1,29 @@
import { describe, expect, test } from "bun:test"
import path from "path"
const SCRIPTS_DIR = path.join(
const INVENTORY_SCRIPTS_DIR = path.join(
__dirname,
"../plugins/compound-engineering/agents/research/session-history-scripts"
"../plugins/compound-engineering/skills/ce-session-inventory/scripts"
)
const EXTRACT_SCRIPTS_DIR = path.join(
__dirname,
"../plugins/compound-engineering/skills/ce-session-extract/scripts"
)
const FIXTURES_DIR = path.join(__dirname, "fixtures/session-history")
function scriptsDirFor(scriptName: string): string {
if (scriptName === "extract-metadata.py" || scriptName === "discover-sessions.sh") {
return INVENTORY_SCRIPTS_DIR
}
return EXTRACT_SCRIPTS_DIR
}
async function runScript(
scriptName: string,
args: string[] = [],
stdin?: string
): Promise<{ stdout: string; stderr: string; exitCode: number }> {
const scriptPath = path.join(SCRIPTS_DIR, scriptName)
const scriptPath = path.join(scriptsDirFor(scriptName), scriptName)
const proc = Bun.spawn(["python3", scriptPath, ...args], {
stdin: stdin ? new TextEncoder().encode(stdin) : undefined,
stdout: "pipe",
@@ -420,7 +431,7 @@ describe("discover-sessions", () => {
async function runDiscover(
...args: string[]
): Promise<{ stdout: string; stderr: string; exitCode: number }> {
const scriptPath = path.join(SCRIPTS_DIR, "discover-sessions.sh")
const scriptPath = path.join(scriptsDirFor("discover-sessions.sh"), "discover-sessions.sh")
const proc = Bun.spawn(["bash", scriptPath, ...args], {
stdout: "pipe",
stderr: "pipe",