@kolisachint/hoocode-agent 0.2.6 → 0.3.0

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.
@@ -355,7 +355,7 @@ export class InteractiveMode {
355
355
  return;
356
356
  }
357
357
  this.startupNoticesShown = true;
358
- if (!this.changelogMarkdown) {
358
+ if (!this.changelogMarkdown || !this.changelogMarkdown.trim()) {
359
359
  return;
360
360
  }
361
361
  if (this.chatContainer.children.length > 0) {
@@ -975,65 +975,93 @@ export class InteractiveMode {
975
975
  }
976
976
  }
977
977
  if (showListing) {
978
- const contextFiles = this.session.resourceLoader.getAgentsFiles().agentsFiles;
979
- if (contextFiles.length > 0) {
980
- this.chatContainer.addChild(new Spacer(1));
981
- const contextList = contextFiles
982
- .map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
983
- .join("\n");
984
- const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
985
- addLoadedSection("Context", contextCompactList, contextList);
986
- }
978
+ const { agentsFiles: contextFiles, warnings: contextWarnings } = this.session.resourceLoader.getAgentsFiles();
987
979
  const skills = skillsResult.skills;
988
- if (skills.length > 0) {
989
- const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
990
- const skillList = this.formatScopeGroups(groups, {
991
- formatPath: (item) => this.formatDisplayPath(item.path),
992
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
993
- });
994
- const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
995
- addLoadedSection("Skills", skillCompactList, skillList);
996
- }
997
980
  const templates = this.session.promptTemplates;
998
- if (templates.length > 0) {
999
- const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
1000
- const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
1001
- const templateList = this.formatScopeGroups(groups, {
1002
- formatPath: (item) => {
1003
- const template = templateByPath.get(item.path);
1004
- return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1005
- },
1006
- formatPackagePath: (item) => {
1007
- const template = templateByPath.get(item.path);
1008
- return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1009
- },
1010
- });
1011
- const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
1012
- addLoadedSection("Prompts", promptCompactList, templateList);
1013
- }
1014
- if (extensions.length > 0) {
1015
- const groups = this.buildScopeGroups(extensions);
1016
- const extList = this.formatScopeGroups(groups, {
1017
- formatPath: (item) => this.formatExtensionDisplayPath(item.path),
1018
- formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
1019
- });
1020
- const extensionCompactList = formatCompactList(this.getCompactExtensionLabels(extensions));
1021
- addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
1022
- }
1023
- // Show loaded themes (excluding built-in)
1024
981
  const loadedThemes = themesResult.themes;
1025
982
  const customThemes = loadedThemes.filter((t) => t.sourcePath);
1026
- if (customThemes.length > 0) {
1027
- const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
1028
- path: loadedTheme.sourcePath,
1029
- sourceInfo: loadedTheme.sourceInfo,
1030
- })));
1031
- const themeList = this.formatScopeGroups(groups, {
1032
- formatPath: (item) => this.formatDisplayPath(item.path),
1033
- formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1034
- });
1035
- const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
1036
- addLoadedSection("Themes", themeCompactList, themeList);
983
+ const totalItems = contextFiles.length + skills.length + templates.length + extensions.length + customThemes.length;
984
+ if (totalItems > 0 && totalItems <= 5) {
985
+ this.chatContainer.addChild(new Spacer(1));
986
+ const allCompactItems = [];
987
+ if (contextFiles.length > 0) {
988
+ allCompactItems.push(...contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)));
989
+ }
990
+ if (skills.length > 0) {
991
+ allCompactItems.push(...skills.map((skill) => skill.name));
992
+ }
993
+ if (templates.length > 0) {
994
+ allCompactItems.push(...templates.map((template) => `/${template.name}`));
995
+ }
996
+ if (extensions.length > 0) {
997
+ allCompactItems.push(...this.getCompactExtensionLabels(extensions));
998
+ }
999
+ if (customThemes.length > 0) {
1000
+ allCompactItems.push(...customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
1001
+ }
1002
+ addLoadedSection("Resources", formatCompactList(allCompactItems), formatCompactList(allCompactItems));
1003
+ }
1004
+ else {
1005
+ if (contextFiles.length > 0) {
1006
+ this.chatContainer.addChild(new Spacer(1));
1007
+ const contextList = contextFiles
1008
+ .map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
1009
+ .join("\n");
1010
+ const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
1011
+ addLoadedSection("Context", contextCompactList, contextList);
1012
+ }
1013
+ if (skills.length > 0) {
1014
+ const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
1015
+ const skillList = this.formatScopeGroups(groups, {
1016
+ formatPath: (item) => this.formatDisplayPath(item.path),
1017
+ formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1018
+ });
1019
+ const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
1020
+ addLoadedSection("Skills", skillCompactList, skillList);
1021
+ }
1022
+ if (templates.length > 0) {
1023
+ const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
1024
+ const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
1025
+ const templateList = this.formatScopeGroups(groups, {
1026
+ formatPath: (item) => {
1027
+ const template = templateByPath.get(item.path);
1028
+ return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1029
+ },
1030
+ formatPackagePath: (item) => {
1031
+ const template = templateByPath.get(item.path);
1032
+ return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1033
+ },
1034
+ });
1035
+ const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
1036
+ addLoadedSection("Prompts", promptCompactList, templateList);
1037
+ }
1038
+ if (extensions.length > 0) {
1039
+ const groups = this.buildScopeGroups(extensions);
1040
+ const extList = this.formatScopeGroups(groups, {
1041
+ formatPath: (item) => this.formatExtensionDisplayPath(item.path),
1042
+ formatPackagePath: (item) => this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
1043
+ });
1044
+ const extensionCompactList = formatCompactList(this.getCompactExtensionLabels(extensions));
1045
+ addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
1046
+ }
1047
+ if (customThemes.length > 0) {
1048
+ const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
1049
+ path: loadedTheme.sourcePath,
1050
+ sourceInfo: loadedTheme.sourceInfo,
1051
+ })));
1052
+ const themeList = this.formatScopeGroups(groups, {
1053
+ formatPath: (item) => this.formatDisplayPath(item.path),
1054
+ formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1055
+ });
1056
+ const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
1057
+ addLoadedSection("Themes", themeCompactList, themeList);
1058
+ }
1059
+ }
1060
+ if (contextWarnings.length > 0) {
1061
+ for (const warning of contextWarnings) {
1062
+ this.chatContainer.addChild(new Text(theme.fg("warning", ` ${warning}`), 0, 0));
1063
+ }
1064
+ this.chatContainer.addChild(new Spacer(1));
1037
1065
  }
1038
1066
  }
1039
1067
  if (showDiagnostics) {
@@ -4252,12 +4280,17 @@ export class InteractiveMode {
4252
4280
  handleChangelogCommand() {
4253
4281
  const changelogPath = getChangelogPath();
4254
4282
  const allEntries = parseChangelog(changelogPath);
4255
- const changelogMarkdown = allEntries.length > 0
4256
- ? allEntries
4257
- .reverse()
4258
- .map((e) => e.content)
4259
- .join("\n\n")
4260
- : "No changelog entries found.";
4283
+ if (allEntries.length === 0) {
4284
+ this.chatContainer.addChild(new Spacer(1));
4285
+ this.chatContainer.addChild(new Text(theme.fg("dim", "No changelog entries found."), 1, 0));
4286
+ this.ui.requestRender();
4287
+ return;
4288
+ }
4289
+ const changelogMarkdown = allEntries
4290
+ .slice()
4291
+ .reverse()
4292
+ .map((e) => e.content)
4293
+ .join("\n\n");
4261
4294
  this.chatContainer.addChild(new Spacer(1));
4262
4295
  this.chatContainer.addChild(new DynamicBorder());
4263
4296
  this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));