MCPcopy Index your code
hub / github.com/simstudioai/sim / stableCompare

Function stableCompare

apps/sim/lib/copilot/chat/workspace-context.ts:99–101  ·  view source on GitHub ↗

* Deterministic string ordering. The workspace inventory is placed in the * prompt-cache prefix (mothership), so its bytes must be identical for identical * workspace state regardless of DB row order — otherwise the cache silently * busts every turn. `localeCompare` with a pinned locale gives sta

(a: string, b: string)

Source from the content-addressed store, hash-verified

97 * ordering across Sim instances (all run the same Node/ICU build).
98 */
99function stableCompare(a: string, b: string): number {
100 return a.localeCompare(b, 'en')
101}
102
103/** Stable order by display name, tie-broken by id, for inventory listings. */
104function byNameThenId(a: { name: string; id: string }, b: { name: string; id: string }): number {

Callers 2

byNameThenIdFunction · 0.85
buildWorkspaceMdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected