Overhaul Feynman harness: streamline agents, prompts, and extensions
Remove legacy chains, skills, and config modules. Add citation agent, SYSTEM.md, modular research-tools extension, and web-access layer. Add ralph-wiggum to Pi package stack for long-running loops. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -77,10 +77,11 @@ ensurePackageWorkspace();
|
||||
|
||||
if (existsSync(packageJsonPath)) {
|
||||
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
||||
if (pkg.piConfig?.name !== "feynman") {
|
||||
if (pkg.piConfig?.name !== "feynman" || pkg.piConfig?.configDir !== ".feynman") {
|
||||
pkg.piConfig = {
|
||||
...(pkg.piConfig || {}),
|
||||
name: "feynman",
|
||||
configDir: ".feynman",
|
||||
};
|
||||
writeFileSync(packageJsonPath, JSON.stringify(pkg, null, "\t") + "\n", "utf8");
|
||||
}
|
||||
@@ -117,7 +118,7 @@ if (existsSync(interactiveThemePath)) {
|
||||
" return {",
|
||||
' borderColor: (text) => " ".repeat(text.length),',
|
||||
' bgColor: (text) => theme.bg("userMessageBg", text),',
|
||||
' placeholderText: "Type your message",',
|
||||
' placeholderText: "Type your message or /help for commands",',
|
||||
' placeholder: (text) => theme.fg("dim", text),',
|
||||
" selectList: getSelectListTheme(),",
|
||||
" };",
|
||||
@@ -212,51 +213,25 @@ if (existsSync(editorPath)) {
|
||||
" const isFirstLayoutLine = this.scrollOffset + visibleIndex === 0;",
|
||||
" let displayText = layoutLine.text;",
|
||||
" let lineVisibleWidth = visibleWidth(layoutLine.text);",
|
||||
" let cursorInPadding = false;",
|
||||
" const isPlaceholderLine = showPlaceholder && isFirstLayoutLine;",
|
||||
" // Add cursor if this line has it",
|
||||
" if (isPlaceholderLine) {",
|
||||
" const marker = emitCursorMarker ? CURSOR_MARKER : \"\";",
|
||||
" const rawPlaceholder = this.theme.placeholderText;",
|
||||
" const graphemes = [...this.segment(rawPlaceholder)];",
|
||||
' const firstGrapheme = graphemes[0]?.segment ?? " ";',
|
||||
" const restRaw = rawPlaceholder.slice(firstGrapheme.length);",
|
||||
' const restStyled = typeof this.theme.placeholder === "function"',
|
||||
" ? this.theme.placeholder(restRaw)",
|
||||
" : restRaw;",
|
||||
' displayText = marker + `\\x1b[7m${firstGrapheme}\\x1b[27m` + restStyled;',
|
||||
' const styledPlaceholder = typeof this.theme.placeholder === "function"',
|
||||
" ? this.theme.placeholder(rawPlaceholder)",
|
||||
" : rawPlaceholder;",
|
||||
" displayText = marker + styledPlaceholder;",
|
||||
" lineVisibleWidth = visibleWidth(rawPlaceholder);",
|
||||
" }",
|
||||
" else if (layoutLine.hasCursor && layoutLine.cursorPos !== undefined) {",
|
||||
' const marker = emitCursorMarker ? CURSOR_MARKER : "";',
|
||||
" const before = displayText.slice(0, layoutLine.cursorPos);",
|
||||
" const after = displayText.slice(layoutLine.cursorPos);",
|
||||
" // Hardware cursor marker (zero-width, emitted before fake cursor for IME positioning)",
|
||||
' const marker = emitCursorMarker ? CURSOR_MARKER : "";',
|
||||
" if (after.length > 0) {",
|
||||
" // Cursor is on a character (grapheme) - replace it with highlighted version",
|
||||
" // Get the first grapheme from 'after'",
|
||||
" const afterGraphemes = [...this.segment(after)];",
|
||||
' const firstGrapheme = afterGraphemes[0]?.segment || "";',
|
||||
" const restAfter = after.slice(firstGrapheme.length);",
|
||||
' const cursor = `\\x1b[7m${firstGrapheme}\\x1b[27m`;',
|
||||
" displayText = before + marker + cursor + restAfter;",
|
||||
" // lineVisibleWidth stays the same - we're replacing, not adding",
|
||||
" }",
|
||||
" else {",
|
||||
" // Cursor is at the end - add highlighted space",
|
||||
' const cursor = "\\x1b[7m \\x1b[27m";',
|
||||
" displayText = before + marker + cursor;",
|
||||
" lineVisibleWidth = lineVisibleWidth + 1;",
|
||||
" // If cursor overflows content width into the padding, flag it",
|
||||
" if (lineVisibleWidth > contentWidth && paddingX > 0) {",
|
||||
" cursorInPadding = true;",
|
||||
" }",
|
||||
" }",
|
||||
" displayText = before + marker + after;",
|
||||
" }",
|
||||
" // Calculate padding based on actual visible width",
|
||||
' const padding = " ".repeat(Math.max(0, contentWidth - lineVisibleWidth));',
|
||||
" const lineRightPadding = cursorInPadding ? rightPadding.slice(1) : rightPadding;",
|
||||
" const renderedLine = `${leftPadding}${displayText}${padding}${lineRightPadding}`;",
|
||||
" const renderedLine = `${leftPadding}${displayText}${padding}${rightPadding}`;",
|
||||
" result.push(bgColor ? applyBackgroundToLine(renderedLine, width, bgColor) : renderedLine);",
|
||||
" }",
|
||||
" // Render bottom padding row. When background fill is active, mimic the user-message block",
|
||||
|
||||
Reference in New Issue
Block a user