MCPcopy Index your code
hub / github.com/callstack/agent-device / formatUnchangedSnapshotText

Function formatUnchangedSnapshotText

src/utils/output.ts:126–144  ·  view source on GitHub ↗
(unchanged: SnapshotUnchanged)

Source from the content-addressed store, hash-verified

124}
125
126function formatUnchangedSnapshotText(unchanged: SnapshotUnchanged): string {
127 const age = formatSnapshotAge(unchanged.ageMs);
128 if (unchanged.scope) {
129 return [
130 `Scoped snapshot unchanged for scope "${unchanged.scope}" since previous read ${age} ago.`,
131 'Previous refs in this scope remain valid. Use find/get/is for a targeted query, or --force-full to re-emit.',
132 ].join('\n');
133 }
134 if (unchanged.interactiveOnly) {
135 return [
136 `Interactive snapshot unchanged since previous read ${age} ago.`,
137 `${unchanged.nodeCount} visible nodes are unchanged. Previous @e refs are still valid. Use find/get/is for a targeted query, or --force-full to re-emit.`,
138 ].join('\n');
139 }
140 return [
141 `Snapshot unchanged since previous read ${age} ago.`,
142 'Refs from the previous snapshot are still valid. Use --force-full to re-emit the tree, or use find/get/is for a targeted query.',
143 ].join('\n');
144}
145
146function formatSnapshotAge(ageMs: number): string {
147 if (ageMs < 1000) return `${Math.round(ageMs)}ms`;

Callers 1

formatSnapshotTextFunction · 0.85

Calls 1

formatSnapshotAgeFunction · 0.85

Tested by

no test coverage detected