fix(coding-agent): attach source info to resources and commands, fixes #1734
This commit is contained in:
@@ -6,6 +6,7 @@ import { TypeCompiler } from "@sinclair/typebox/compiler";
|
||||
import chalk from "chalk";
|
||||
import { highlight, supportsLanguage } from "cli-highlight";
|
||||
import { getCustomThemesDir, getThemesDir } from "../../../config.js";
|
||||
import type { SourceInfo } from "../../../core/source-info.js";
|
||||
|
||||
// ============================================================================
|
||||
// Types & Schema
|
||||
@@ -341,6 +342,7 @@ function resolveThemeColors<T extends Record<string, ColorValue>>(
|
||||
export class Theme {
|
||||
readonly name?: string;
|
||||
readonly sourcePath?: string;
|
||||
sourceInfo?: SourceInfo;
|
||||
private fgColors: Map<ThemeColor, string>;
|
||||
private bgColors: Map<ThemeBg, string>;
|
||||
private mode: ColorMode;
|
||||
@@ -349,10 +351,11 @@ export class Theme {
|
||||
fgColors: Record<ThemeColor, string | number>,
|
||||
bgColors: Record<ThemeBg, string | number>,
|
||||
mode: ColorMode,
|
||||
options: { name?: string; sourcePath?: string } = {},
|
||||
options: { name?: string; sourcePath?: string; sourceInfo?: SourceInfo } = {},
|
||||
) {
|
||||
this.name = options.name;
|
||||
this.sourcePath = options.sourcePath;
|
||||
this.sourceInfo = options.sourceInfo;
|
||||
this.mode = mode;
|
||||
this.fgColors = new Map();
|
||||
for (const [key, value] of Object.entries(fgColors) as [ThemeColor, string | number][]) {
|
||||
|
||||
Reference in New Issue
Block a user