@kolisachint/hoocode-agent 0.2.7 → 0.3.1

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) {
@@ -778,6 +778,9 @@ export class InteractiveMode {
778
778
  })
779
779
  .filter((extension) => !this.isPackageSource(extension.sourceInfo));
780
780
  return extensions.map((extension) => {
781
+ if (extension.displayName) {
782
+ return extension.displayName;
783
+ }
781
784
  if (this.isPackageSource(extension.sourceInfo)) {
782
785
  return this.getCompactExtensionLabel(extension.path, extension.sourceInfo);
783
786
  }
@@ -952,6 +955,7 @@ export class InteractiveMode {
952
955
  this.session.resourceLoader.getExtensions().extensions.map((extension) => ({
953
956
  path: extension.path,
954
957
  sourceInfo: extension.sourceInfo,
958
+ displayName: extension.displayName,
955
959
  }));
956
960
  const sourceInfos = new Map();
957
961
  for (const extension of extensions) {
@@ -975,65 +979,93 @@ export class InteractiveMode {
975
979
  }
976
980
  }
977
981
  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
- }
982
+ const { agentsFiles: contextFiles, warnings: contextWarnings } = this.session.resourceLoader.getAgentsFiles();
987
983
  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
984
  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
985
  const loadedThemes = themesResult.themes;
1025
986
  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);
987
+ const totalItems = contextFiles.length + skills.length + templates.length + extensions.length + customThemes.length;
988
+ if (totalItems > 0 && totalItems <= 5) {
989
+ this.chatContainer.addChild(new Spacer(1));
990
+ const allCompactItems = [];
991
+ if (contextFiles.length > 0) {
992
+ allCompactItems.push(...contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)));
993
+ }
994
+ if (skills.length > 0) {
995
+ allCompactItems.push(...skills.map((skill) => skill.name));
996
+ }
997
+ if (templates.length > 0) {
998
+ allCompactItems.push(...templates.map((template) => `/${template.name}`));
999
+ }
1000
+ if (extensions.length > 0) {
1001
+ allCompactItems.push(...this.getCompactExtensionLabels(extensions));
1002
+ }
1003
+ if (customThemes.length > 0) {
1004
+ allCompactItems.push(...customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
1005
+ }
1006
+ addLoadedSection("Resources", formatCompactList(allCompactItems), formatCompactList(allCompactItems));
1007
+ }
1008
+ else {
1009
+ if (contextFiles.length > 0) {
1010
+ this.chatContainer.addChild(new Spacer(1));
1011
+ const contextList = contextFiles
1012
+ .map((f) => theme.fg("dim", ` ${this.formatDisplayPath(f.path)}`))
1013
+ .join("\n");
1014
+ const contextCompactList = formatCompactList(contextFiles.map((contextFile) => this.formatContextPath(contextFile.path)), { sort: false });
1015
+ addLoadedSection("Context", contextCompactList, contextList);
1016
+ }
1017
+ if (skills.length > 0) {
1018
+ const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
1019
+ const skillList = this.formatScopeGroups(groups, {
1020
+ formatPath: (item) => this.formatDisplayPath(item.path),
1021
+ formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1022
+ });
1023
+ const skillCompactList = formatCompactList(skills.map((skill) => skill.name));
1024
+ addLoadedSection("Skills", skillCompactList, skillList);
1025
+ }
1026
+ if (templates.length > 0) {
1027
+ const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
1028
+ const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
1029
+ const templateList = this.formatScopeGroups(groups, {
1030
+ formatPath: (item) => {
1031
+ const template = templateByPath.get(item.path);
1032
+ return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1033
+ },
1034
+ formatPackagePath: (item) => {
1035
+ const template = templateByPath.get(item.path);
1036
+ return template ? `/${template.name}` : this.formatDisplayPath(item.path);
1037
+ },
1038
+ });
1039
+ const promptCompactList = formatCompactList(templates.map((template) => `/${template.name}`));
1040
+ addLoadedSection("Prompts", promptCompactList, templateList);
1041
+ }
1042
+ if (extensions.length > 0) {
1043
+ const groups = this.buildScopeGroups(extensions);
1044
+ const extList = this.formatScopeGroups(groups, {
1045
+ formatPath: (item) => item.displayName ?? this.formatExtensionDisplayPath(item.path),
1046
+ formatPackagePath: (item) => item.displayName ?? this.formatExtensionDisplayPath(this.getShortPath(item.path, item.sourceInfo)),
1047
+ });
1048
+ const extensionCompactList = formatCompactList(this.getCompactExtensionLabels(extensions));
1049
+ addLoadedSection("Extensions", extensionCompactList, extList, "mdHeading");
1050
+ }
1051
+ if (customThemes.length > 0) {
1052
+ const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
1053
+ path: loadedTheme.sourcePath,
1054
+ sourceInfo: loadedTheme.sourceInfo,
1055
+ })));
1056
+ const themeList = this.formatScopeGroups(groups, {
1057
+ formatPath: (item) => this.formatDisplayPath(item.path),
1058
+ formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
1059
+ });
1060
+ const themeCompactList = formatCompactList(customThemes.map((loadedTheme) => loadedTheme.name ?? this.getCompactPathLabel(loadedTheme.sourcePath, loadedTheme.sourceInfo)));
1061
+ addLoadedSection("Themes", themeCompactList, themeList);
1062
+ }
1063
+ }
1064
+ if (contextWarnings.length > 0) {
1065
+ for (const warning of contextWarnings) {
1066
+ this.chatContainer.addChild(new Text(theme.fg("warning", ` ${warning}`), 0, 0));
1067
+ }
1068
+ this.chatContainer.addChild(new Spacer(1));
1037
1069
  }
1038
1070
  }
1039
1071
  if (showDiagnostics) {
@@ -4252,12 +4284,17 @@ export class InteractiveMode {
4252
4284
  handleChangelogCommand() {
4253
4285
  const changelogPath = getChangelogPath();
4254
4286
  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.";
4287
+ if (allEntries.length === 0) {
4288
+ this.chatContainer.addChild(new Spacer(1));
4289
+ this.chatContainer.addChild(new Text(theme.fg("dim", "No changelog entries found."), 1, 0));
4290
+ this.ui.requestRender();
4291
+ return;
4292
+ }
4293
+ const changelogMarkdown = allEntries
4294
+ .slice()
4295
+ .reverse()
4296
+ .map((e) => e.content)
4297
+ .join("\n\n");
4261
4298
  this.chatContainer.addChild(new Spacer(1));
4262
4299
  this.chatContainer.addChild(new DynamicBorder());
4263
4300
  this.chatContainer.addChild(new Text(theme.bold(theme.fg("accent", "What's New")), 1, 0));