style(session): satisfy biome and SkillPromptDetails typing
This commit is contained in:
@@ -308,7 +308,6 @@ import {
|
||||
sanitizeAssistantForReparentedHistory,
|
||||
USER_INTERRUPT_LABEL,
|
||||
} from "./messages";
|
||||
import { skillPromptTitleInput } from "./skill-title-input";
|
||||
import { ModelControls, type ModelControlsHost } from "./model-controls";
|
||||
import { isPrewalkPlanNudge, PrewalkCoordinator, type PrewalkCoordinatorHost } from "./prewalk";
|
||||
import {
|
||||
@@ -339,6 +338,7 @@ import { SessionProviderBoundary, type SessionProviderBoundaryHost } from "./ses
|
||||
import { SessionStatsTracker, type SessionStatsTrackerHost } from "./session-stats";
|
||||
import { SessionTools, type SessionToolsHost } from "./session-tools";
|
||||
import type { ShakeMode, ShakeResult } from "./shake-types";
|
||||
import { skillPromptTitleInput } from "./skill-title-input";
|
||||
import { ToolChoiceQueue } from "./tool-choice-queue";
|
||||
import { planTurnPersistence, sameMessageContent, sessionMessagePersistenceKey } from "./turn-persistence";
|
||||
import { TurnRecovery, type TurnRecoveryHost } from "./turn-recovery";
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
/** Compact title-model input for a user-invoked `/skill:<name>` prompt. */
|
||||
export function skillPromptTitleInput(input: {
|
||||
name?: string;
|
||||
args?: string;
|
||||
queueChipText?: string;
|
||||
}): string {
|
||||
export function skillPromptTitleInput(input: { name?: string; args?: string; queueChipText?: string }): string {
|
||||
const chip = input.queueChipText?.trim();
|
||||
if (chip) return chip;
|
||||
const name = input.name?.trim();
|
||||
|
||||
@@ -2,8 +2,8 @@ import { describe, expect, it } from "bun:test";
|
||||
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
||||
import type { AssistantMessage } from "@oh-my-pi/pi-ai";
|
||||
import {
|
||||
type CustomMessage,
|
||||
buildReplanTitleContext,
|
||||
type CustomMessage,
|
||||
convertToLlm,
|
||||
INTERRUPTED_THINKING_MESSAGE_TYPE,
|
||||
replaceLlmImagesWithText,
|
||||
@@ -289,7 +289,7 @@ describe("buildReplanTitleContext", () => {
|
||||
role: "custom",
|
||||
customType: SKILL_PROMPT_MESSAGE_TYPE,
|
||||
content:
|
||||
"[IMPORTANT: User invoked the \"implement\" skill]\n\nImplement the work described by the user.\n\nUse this skill.",
|
||||
'[IMPORTANT: User invoked the "implement" skill]\n\nImplement the work described by the user.\n\nUse this skill.',
|
||||
display: true,
|
||||
details: {
|
||||
name: "implement",
|
||||
@@ -310,7 +310,7 @@ describe("buildReplanTitleContext", () => {
|
||||
|
||||
it("does not feed an autoloaded skill prompt into title context", () => {
|
||||
const skill = customMessage(SKILL_PROMPT_MESSAGE_TYPE, "agent");
|
||||
skill.details = { ...skill.details, args: "issues/07-manual-llm.md" };
|
||||
skill.details = { name: "atomic-commit", path: "/tmp/SKILL.md", lineCount: 1, args: "issues/07-manual-llm.md" };
|
||||
|
||||
expect(buildReplanTitleContext([skill])).toBe("");
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { formatTitleConversationContext } from "../../src/tiny/message-preproc";
|
||||
import { skillPromptTitleInput, titleTextFromSkillPrompt } from "../../src/session/skill-title-input";
|
||||
import { formatTitleConversationContext } from "../../src/tiny/message-preproc";
|
||||
|
||||
describe("skillPromptTitleInput", () => {
|
||||
it("uses the operator /skill chip when present", () => {
|
||||
|
||||
Reference in New Issue
Block a user