MCPcopy Create free account
hub / github.com/cloudflare/agents / summarizeTree

Function summarizeTree

packages/shell/src/extras.ts:93–108  ·  view source on GitHub ↗
(
  root: string,
  ops: TreeOps,
  options: StateTreeOptions = {}
)

Source from the content-addressed store, hash-verified

91}
92
93export async function summarizeTree(
94 root: string,
95 ops: TreeOps,
96 options: StateTreeOptions = {}
97): Promise<StateTreeSummary> {
98 const tree = await buildTree(root, ops, options);
99 const summary: StateTreeSummary = {
100 files: 0,
101 directories: 0,
102 symlinks: 0,
103 totalBytes: 0,
104 maxDepth: 0
105 };
106 summarizeNode(tree, 0, summary);
107 return summary;
108}
109
110export async function findInTree(
111 root: string,

Callers 1

summarizeTreeMethod · 0.90

Calls 2

buildTreeFunction · 0.85
summarizeNodeFunction · 0.85

Tested by

no test coverage detected