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

Function estimateOpSizeBytes

apps/sim/lib/knowledge/connectors/sync-engine.ts:110–118  ·  view source on GitHub ↗

Estimated source bytes for a pending op, taken from its listing metadata.

(op: DocOp)

Source from the content-addressed store, hash-verified

108
109/** Estimated source bytes for a pending op, taken from its listing metadata. */
110function estimateOpSizeBytes(op: DocOp): number {
111 // Skip ops load no content (just a row insert), so they do not count against the
112 // in-flight content budget.
113 if (op.type === 'skip') return 0
114 const size = op.extDoc.metadata?.fileSize ?? op.extDoc.metadata?.size
115 return typeof size === 'number' && Number.isFinite(size) && size > 0
116 ? size
117 : DEFAULT_OP_SIZE_BYTES
118}
119
120/**
121 * Splits content ops into sub-chunks bounded by both a count (maxCount) and a summed

Callers 1

chunkOpsByByteBudgetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected