tests(coding-agent): updated keyword comments to workflowz
- Aligned doc comments and tests with the workflowz trigger rename.
This commit is contained in:
@@ -76,7 +76,7 @@ export function extractBracketedImagePastePath(data: string): string | undefined
|
||||
export class CustomEditor extends Editor {
|
||||
imageLinks?: readonly (string | undefined)[];
|
||||
|
||||
/** Gradient-highlight the "ultrathink" / "orchestrate" / "workflow" keywords as the user types
|
||||
/** Gradient-highlight the "ultrathink" / "orchestrate" / "workflowz" keywords as the user types
|
||||
* them, skipping any occurrence inside code spans, fenced blocks, or XML sections. Also make
|
||||
* pasted image placeholders visually distinct and hyperlink them once their blob file exists. */
|
||||
decorateText = (text: string): string =>
|
||||
|
||||
@@ -15,7 +15,7 @@ export class UserMessageComponent extends Container {
|
||||
constructor(text: string, synthetic = false, imageLinks?: readonly (string | undefined)[]) {
|
||||
super();
|
||||
const bgColor = (value: string) => theme.bg("userMessageBg", value);
|
||||
// Paint the magic keywords ("ultrathink"/"orchestrate"/"workflow") inside the rendered
|
||||
// Paint the magic keywords ("ultrathink"/"orchestrate"/"workflowz") inside the rendered
|
||||
// bubble too — matching the live editor glow. The Markdown component routes code spans and
|
||||
// fenced blocks through its own code styling (never `color`), so those are already excluded;
|
||||
// `highlightMagicKeywords` additionally restores the bubble's own foreground after each
|
||||
|
||||
@@ -4,7 +4,7 @@ import { highlightWorkflow } from "./workflow";
|
||||
|
||||
/**
|
||||
* Gradient-highlight every magic keyword ("ultrathink", "orchestrate",
|
||||
* "workflow") that appears as standalone prose, skipping any occurrence inside a
|
||||
* "workflowz") that appears as standalone prose, skipping any occurrence inside a
|
||||
* code block, inline code span, or XML/HTML section. Each highlighter paints its
|
||||
* own keyword with its own gradient, so chaining is order-independent — the
|
||||
* earlier passes only inject zero-width SGR escapes (no backticks or angle
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Markdown structure awareness for the magic-keyword affordances
|
||||
* ("ultrathink"/"orchestrate"/"workflow").
|
||||
* ("ultrathink"/"orchestrate"/"workflowz").
|
||||
*
|
||||
* Keyword detection and editor/transcript highlighting must fire only on prose
|
||||
* the user is actually addressing to the model — never on a word that happens to
|
||||
|
||||
@@ -9,21 +9,21 @@ beforeAll(async () => {
|
||||
|
||||
describe("highlightMagicKeywords", () => {
|
||||
it("paints every magic keyword in a single prose pass, preserving visible text", () => {
|
||||
const input = "first ultrathink then orchestrate the workflow";
|
||||
const input = "first ultrathink then orchestrate the workflowz";
|
||||
const decorated = highlightMagicKeywords(input);
|
||||
expect(decorated).not.toBe(input);
|
||||
expect(decorated).toContain("\x1b[38");
|
||||
expect(Bun.stripANSI(decorated)).toBe(input);
|
||||
// Each keyword is gradient-painted character-by-character, so none survives as a
|
||||
// contiguous run in the decorated output.
|
||||
for (const keyword of ["ultrathink", "orchestrate", "workflow"]) {
|
||||
for (const keyword of ["ultrathink", "orchestrate", "workflowz"]) {
|
||||
expect(decorated).not.toContain(keyword);
|
||||
expect(Bun.stripANSI(decorated)).toContain(keyword);
|
||||
}
|
||||
});
|
||||
|
||||
it("never paints keywords inside code spans, fenced blocks, or XML sections", () => {
|
||||
const input = "`ultrathink`\n```\norchestrate\n```\n<x>workflow</x>";
|
||||
const input = "`ultrathink`\n```\norchestrate\n```\n<x>workflowz</x>";
|
||||
expect(highlightMagicKeywords(input)).toBe(input);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user