@oh-my-pi/pi-coding-agent 13.7.0 → 13.7.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-coding-agent",
4
- "version": "13.7.0",
4
+ "version": "13.7.1",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -41,12 +41,12 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@mozilla/readability": "^0.6",
44
- "@oh-my-pi/omp-stats": "13.7.0",
45
- "@oh-my-pi/pi-agent-core": "13.7.0",
46
- "@oh-my-pi/pi-ai": "13.7.0",
47
- "@oh-my-pi/pi-natives": "13.7.0",
48
- "@oh-my-pi/pi-tui": "13.7.0",
49
- "@oh-my-pi/pi-utils": "13.7.0",
44
+ "@oh-my-pi/omp-stats": "13.7.1",
45
+ "@oh-my-pi/pi-agent-core": "13.7.1",
46
+ "@oh-my-pi/pi-ai": "13.7.1",
47
+ "@oh-my-pi/pi-natives": "13.7.1",
48
+ "@oh-my-pi/pi-tui": "13.7.1",
49
+ "@oh-my-pi/pi-utils": "13.7.1",
50
50
  "@sinclair/typebox": "^0.34",
51
51
  "@xterm/headless": "^6.0",
52
52
  "ajv": "^8.18",
@@ -275,6 +275,16 @@ export interface ScanSkillsFromDirOptions {
275
275
  requireDescription?: boolean;
276
276
  }
277
277
 
278
+ // Stable ordering used for skill lists in prompts: name (case-insensitive), then name, then path.
279
+ export function compareSkillOrder(aName: string, aPath: string, bName: string, bPath: string): number {
280
+ const cmp = (a: string, b: string): number => (a < b ? -1 : a > b ? 1 : 0);
281
+ const lowerCompare = cmp(aName.toLowerCase(), bName.toLowerCase());
282
+ if (lowerCompare !== 0) return lowerCompare;
283
+ const nameCompare = cmp(aName, bName);
284
+ if (nameCompare !== 0) return nameCompare;
285
+ return cmp(aPath, bPath);
286
+ }
287
+
278
288
  export async function scanSkillsFromDir(
279
289
  _ctx: LoadContext,
280
290
  options: ScanSkillsFromDirOptions,
@@ -301,8 +311,10 @@ export async function scanSkillsFromDir(
301
311
  return;
302
312
  }
303
313
  const skillDirName = path.basename(path.dirname(skillPath));
314
+ const rawName = frontmatter.name;
315
+ const name = typeof rawName === "string" ? rawName.trim() || skillDirName : skillDirName;
304
316
  items.push({
305
- name: (frontmatter.name as string) || skillDirName,
317
+ name,
306
318
  path: skillPath,
307
319
  content: body,
308
320
  frontmatter: frontmatter as SkillFrontmatter,
@@ -325,6 +337,9 @@ export async function scanSkillsFromDir(
325
337
  }
326
338
  await Promise.all(work);
327
339
 
340
+ // Deterministic ordering: async file reads complete nondeterministically, so sort after loading.
341
+ items.sort((a, b) => compareSkillOrder(a.name, a.path, b.name, b.path));
342
+
328
343
  return { items, warnings };
329
344
  }
330
345
 
@@ -5,7 +5,7 @@ import { skillCapability } from "../capability/skill";
5
5
  import type { SourceMeta } from "../capability/types";
6
6
  import type { SkillsSettings } from "../config/settings";
7
7
  import { type Skill as CapabilitySkill, loadCapability } from "../discovery";
8
- import { scanSkillsFromDir } from "../discovery/helpers";
8
+ import { compareSkillOrder, scanSkillsFromDir } from "../discovery/helpers";
9
9
  import { expandTilde } from "../tools/path-utils";
10
10
 
11
11
  export interface Skill {
@@ -235,8 +235,12 @@ export async function loadSkills(options: LoadSkillsOptions = {}): Promise<LoadS
235
235
  }
236
236
  }
237
237
 
238
+ const skills = Array.from(skillMap.values());
239
+ // Deterministic ordering for prompt stability (case-insensitive, then exact name, then path).
240
+ skills.sort((a, b) => compareSkillOrder(a.name, a.filePath, b.name, b.filePath));
241
+
238
242
  return {
239
- skills: Array.from(skillMap.values()),
243
+ skills,
240
244
  warnings: [...(result.warnings ?? []).map(w => ({ skillPath: "", message: w })), ...collisionWarnings],
241
245
  };
242
246
  }