@henryqw/pi-auto-compact 1.0.3 → 1.0.4

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.
@@ -70,13 +70,13 @@ function writeConfig(config: Config): void {
70
70
  writeFileSync(file, `${JSON.stringify(config, null, 2)}\n`);
71
71
  }
72
72
 
73
- function configuredTaskRoutes(ctx: ExtensionContext): ResolvedTaskRoute[] | undefined {
73
+ function configuredTaskRoutes(ctx: ExtensionContext): ResolvedTaskRoute[] {
74
74
  let config;
75
75
  try {
76
76
  config = readTaskModelsConfig();
77
77
  } catch {
78
78
  ctx.ui.notify("Couldn't read task model config; using current session model.", "error");
79
- return undefined;
79
+ return [];
80
80
  }
81
81
 
82
82
  const profileName = config.tasks[AUTO_COMPACT_TASK] ?? DEFAULT_AUTO_COMPACT_PROFILE;
@@ -341,7 +341,7 @@ export default function (pi: ExtensionAPI) {
341
341
  }
342
342
 
343
343
  const routes = configuredTaskRoutes(ctx);
344
- if (!routes?.length) return;
344
+ if (!routes.length) return;
345
345
 
346
346
  for (const route of routes) {
347
347
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-auto-compact",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Proactively compact Pi context at a configurable threshold and resume the current task.",
5
5
  "keywords": [
6
6
  "pi-package",