Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/components/ds/ExperimentalBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,13 @@ interface ExperimentalGateProps {

export function ExperimentalGate({ feature, children, fallback }: ExperimentalGateProps) {
const isEnabled = useFeatureFlags((s) => s[feature]);
const t = useTheme();
const meta = FLAG_META[feature];

if (isEnabled) return <>{children}</>;

if (fallback) return <>{fallback}</>;

const meta = FLAG_META[feature];
const t = useTheme();

return (
<div
style={{
Expand Down
3 changes: 1 addition & 2 deletions src/context/PromptRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,5 @@ export function renderRoutedTools<T extends RoutableItem>(matches: RoutedMatch<T
for (const m of matches) {
lines.push(`- **${m.item.name}** — ${m.item.description} (relevance: ${m.score})`);
}
return lines.join('
');
return lines.join('\n');
}
3 changes: 1 addition & 2 deletions src/context/TranscriptCompaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ export class TranscriptCompaction {
if (toolMsgs.length) {
parts.push(`Tool calls: ${toolMsgs.map(m => m.metadata?.toolName ?? 'unknown').join(', ')}`);
}
return parts.join('
');
return parts.join('\n');
}

/** Estimate tokens for a string (rough approximation). */
Expand Down
3 changes: 1 addition & 2 deletions src/graph/reactivePackerWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ export function withReactiveCompaction(
const contentStr = typeof item.content === 'string' ? item.content : '';
const truncatedLength = oldRatio > 0 ? Math.ceil(contentStr.length * (newRatio / oldRatio)) : contentStr.length;
const truncatedContent = contentStr.length > truncatedLength
? contentStr.slice(0, truncatedLength) + '
[... truncated by reactive compaction]'
? contentStr.slice(0, truncatedLength) + '\n[... truncated by reactive compaction]'
: contentStr;
return { ...item, depth: newDepthNumeric, tokens: newTokens, content: truncatedContent };
}
Expand Down
3 changes: 1 addition & 2 deletions src/panels/builder/ConstraintsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ export function ConstraintsSection({ onOpenModal }: { onOpenModal: (config: Cons
</div>
<div>
<span className="text-[13px] font-semibold block mb-1.5" style={{ color: 'var(--m-text-muted)', fontFamily: 'var(--m-font-mono)' }}>Custom Rules</span>
{constraints.customConstraints.split('
').filter(Boolean).map((rule: string, i: number) => (
{constraints.customConstraints.split('\n').filter(Boolean).map((rule: string, i: number) => (
<div key={i} className="flex items-center gap-2 px-3 py-2 rounded-lg mb-1.5" style={{ background: t.isDark ? 'oklch(0.18 0.02 50)' : 'oklch(0.97 0.01 70)', border: `1px solid ${t.isDark ? 'oklch(0.68 0.16 60 / 0.19)' : 'oklch(0.68 0.16 60 / 0.25)'}` }}>
<div style={{ width: 6, height: 6, borderRadius: '50%', background: 'var(--m-intel)', flexShrink: 0 }} />
<span className="flex-1 text-[13px]" style={{ color: 'var(--m-text-primary)', lineHeight: 1.4, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{rule}</span>
Expand Down
26 changes: 8 additions & 18 deletions src/services/systemFrameBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ export function buildProvenanceSection(provenance: ProvenanceSummary): string {
lines.push('</context_provenance>');
}

return lines.join('
');
return lines.join('\n');
}

export function buildSystemFrame(provenance?: ProvenanceSummary): string {
Expand All @@ -62,8 +61,7 @@ export function buildSystemFrame(provenance?: ProvenanceSummary): string {
if (agentMeta.avatar) identity.push(`Avatar: ${agentMeta.avatar}`);
if (agentMeta.tags?.length) identity.push(`Tags: ${agentMeta.tags.join(', ')}`);
parts.push(`<identity>
${identity.join('
')}
${identity.join('\n')}
</identity>`);
}

Expand All @@ -80,17 +78,13 @@ ${identity.join('
lines.push(`Primary Objective: ${instructionState.objectives.primary}`);
if (instructionState.objectives.successCriteria.length > 0)
lines.push(`Success Criteria:
${instructionState.objectives.successCriteria.map(c => `- ${c}`).join('
')}`);
${instructionState.objectives.successCriteria.map(c => `- ${c}`).join('\n')}`);
if (instructionState.objectives.failureModes.length > 0)
lines.push(`Failure Modes to Avoid:
${instructionState.objectives.failureModes.map(f => `- ${f}`).join('
')}`);
${instructionState.objectives.failureModes.map(f => `- ${f}`).join('\n')}`);
}
parts.push(`<instructions>
${lines.join('

')}
${lines.join('\n\n')}
</instructions>`);
}

Expand All @@ -106,8 +100,7 @@ ${lines.join('
if (instructionState.constraints.customConstraints)
constraints.push(`Additional constraints: ${instructionState.constraints.customConstraints}`);
if (constraints.length > 0) parts.push(`<constraints>
${constraints.map(c => `- ${c}`).join('
')}
${constraints.map(c => `- ${c}`).join('\n')}
</constraints>`);

// Workflow
Expand All @@ -128,9 +121,7 @@ ${compiled}
parts.push(provenanceSection);
}

return parts.join('

');
return parts.join('\n\n');
}

/**
Expand Down Expand Up @@ -317,7 +308,6 @@ export function buildToolGuide(): string {
}

return `<tool_guide>
${lines.join('
')}
${lines.join('\n')}
</tool_guide>`;
}
Loading