singularity-forge/src/resources/extensions/shared/path-display.js
Mikael Hugo fb1bd3e5fa refactor(shared): deduplicate shared/ utilities against coding-agent package exports
- Add packages/coding-agent/src/utils/format.ts as the canonical source
  for formatDuration, formatTokenCount, truncateWithEllipsis, sparkline,
  formatDateShort, fileLink, stripAnsi, normalizeStringArray — all already
  exported from @singularity-forge/coding-agent via index.ts.

- Convert shared/format-utils.js to a compatibility shim that re-exports
  the 8 functions from @singularity-forge/coding-agent. All 13 importers
  continue to work with no import changes required.

- Convert shared/path-display.js to a compatibility shim that re-exports
  toPosixPath from @singularity-forge/coding-agent. Implementation in
  packages/coding-agent/src/utils/path-display.ts was already canonical.

- shared/frontmatter.js is intentionally NOT shimmed: splitFrontmatter/
  parseFrontmatterMap have a different API from the package's parseFrontmatter/
  stripFrontmatter (flat-map vs {frontmatter, body} object).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-10 22:41:03 +02:00

12 lines
548 B
JavaScript

/**
* Compatibility shim — re-exports toPosixPath from the canonical
* implementation in @singularity-forge/coding-agent.
*
* All importers of this module continue to work without any import changes.
* The implementation now lives in packages/coding-agent/src/utils/path-display.ts.
*
* Use ONLY for paths entering text the LLM or shell sees.
* Filesystem operations (fs.readFile, path.join, spawn cwd) handle native
* separators correctly and should NOT be normalized.
*/
export { toPosixPath } from "@singularity-forge/coding-agent";