File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ All notable changes to the @codebuff/sdk package will be documented in this file
88
99- ` closeConnection ` method in ` CodebuffClient `
1010
11+ ### Changed
12+
13+ - Automatic parsing of ` knowledgeFiles ` if not provided
14+
1115## [ 0.1.8] - 2025-08-13
1216
1317### Added
Original file line number Diff line number Diff line change @@ -22,7 +22,26 @@ export function initialSessionState(
2222 maxAgentSteps ?: number
2323 } ,
2424) {
25- const { knowledgeFiles = { } , agentDefinitions = [ ] } = options
25+ const { projectFiles = { } , agentDefinitions = [ ] } = options
26+ let { knowledgeFiles } = options
27+
28+ if ( knowledgeFiles === undefined ) {
29+ knowledgeFiles = { }
30+ for ( const [ filePath , fileContents ] of Object . entries ( projectFiles ) ) {
31+ if ( filePath in projectFiles ) {
32+ continue
33+ }
34+ const lowercasePathName = filePath . toLowerCase ( )
35+ if (
36+ ! lowercasePathName . endsWith ( 'knowledge.md' ) &&
37+ ! lowercasePathName . endsWith ( 'claude.md' )
38+ ) {
39+ continue
40+ }
41+
42+ knowledgeFiles [ filePath ] = fileContents
43+ }
44+ }
2645
2746 // Process agentDefinitions array and convert handleSteps functions to strings
2847 const processedAgentTemplates : Record < string , any > = { }
You can’t perform that action at this time.
0 commit comments