jeopi-cli 16.2.27 → 16.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cli.js +2754 -2753
- package/dist/types/advisor/runtime.d.ts +3 -0
- package/dist/types/session/session-history-format.d.ts +12 -0
- package/package.json +13 -12
- package/src/advisor/__tests__/advisor.test.ts +43 -0
- package/src/advisor/runtime.ts +8 -2
- package/src/config/model-registry.ts +39 -6
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/session/session-history-format.ts +18 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { AgentMessage } from "jeopi-agent-core";
|
|
10
10
|
import type { AssistantMessage, ImageContent, TextContent, ToolResultMessage } from "jeopi-ai";
|
|
11
|
+
import { renderDemotedThinking } from "jeopi-ai/dialect";
|
|
11
12
|
import { escapeXmlText } from "jeopi-utils";
|
|
12
13
|
import { INTENT_FIELD } from "jeopi-wire";
|
|
13
14
|
import type {
|
|
@@ -25,6 +26,18 @@ export interface HistoryFormatOptions {
|
|
|
25
26
|
title?: string;
|
|
26
27
|
/** Render assistant thinking blocks (default: elided). */
|
|
27
28
|
includeThinking?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* When rendering thinking (requires `includeThinking`), disguise it through
|
|
31
|
+
* {@link renderDemotedThinking} for this target model id instead of the literal
|
|
32
|
+
* `_thinking:_ ` label. Anthropic's `reasoning_extraction` classifier can flag a
|
|
33
|
+
* transcript that replays a *different* model's prior thinking back at a
|
|
34
|
+
* Fable/Mythos model labeled as "thinking" — this is the same trigger
|
|
35
|
+
* `renderDemotedThinking` already avoids for cross-model/cross-turn replay in the
|
|
36
|
+
* wire layer. Omitted for the human-facing `history://` dump, where the explicit
|
|
37
|
+
* label is more useful than the disguise and there is no live model on the other
|
|
38
|
+
* end to refuse it.
|
|
39
|
+
*/
|
|
40
|
+
demoteThinkingForModelId?: string;
|
|
28
41
|
/** Render tool intent comment before tool call lines. */
|
|
29
42
|
includeToolIntent?: boolean;
|
|
30
43
|
/** Render watched-session roles as inline `**agent**:` / `**user**:` labels (collapsing consecutive same-role messages) instead of `## ` headings, so a primary transcript embedded inside an advisor turn stays visually distinct. */
|
|
@@ -309,7 +322,11 @@ export function formatSessionHistoryMarkdown(messages: unknown[], opts?: History
|
|
|
309
322
|
toolCallLine(block.name, block.arguments, result, opts?.includeToolIntent, opts?.expandEditDiffs),
|
|
310
323
|
);
|
|
311
324
|
} else if (opts?.includeThinking && block.type === "thinking" && block.thinking.trim()) {
|
|
312
|
-
body.push(
|
|
325
|
+
body.push(
|
|
326
|
+
opts.demoteThinkingForModelId
|
|
327
|
+
? renderDemotedThinking(opts.demoteThinkingForModelId, block.thinking).trimEnd()
|
|
328
|
+
: `_thinking:_ ${block.thinking}`,
|
|
329
|
+
);
|
|
313
330
|
}
|
|
314
331
|
// redactedThinking elided entirely (no readable text)
|
|
315
332
|
}
|