File tree Expand file tree Collapse file tree 6 files changed +20
-32
lines changed
Expand file tree Collapse file tree 6 files changed +20
-32
lines changed Original file line number Diff line number Diff line change 22 "name" : " @codebuff/sdk" ,
33 "private" : false ,
44 "access" : " public" ,
5- "version" : " 0.0.1 " ,
5+ "version" : " 0.0.2 " ,
66 "description" : " Official SDK for Codebuff — AI coding agent & framework" ,
77 "license" : " MIT" ,
88 "type" : " module" ,
5151 "url" : " https://github.com/codebuff/codebuff/issues"
5252 },
5353 "dependencies" : {
54- "@codebuff/common " : " workspace:* "
54+ "zod " : " ^3.23.8 "
5555 },
5656 "devDependencies" : {
5757 "@types/node" : " 22" ,
Original file line number Diff line number Diff line change @@ -39,24 +39,16 @@ function main() {
3939 log ( 'Preparing package.json for publishing...' )
4040 const packageJson = JSON . parse ( fs . readFileSync ( 'package.json' , 'utf8' ) )
4141
42- // Remove workspace dependencies and replace with actual versions
43- if ( packageJson . dependencies && packageJson . dependencies [ '@codebuff/common' ] ) {
44- // For now, we'll make it a peer dependency since it's not published yet
45- delete packageJson . dependencies [ '@codebuff/common' ]
46- if ( ! packageJson . peerDependencies ) {
47- packageJson . peerDependencies = { }
48- }
49- packageJson . peerDependencies [ '@codebuff/common' ] = '*'
50- }
42+ // No workspace dependencies to handle anymore
5143
5244 // Update paths for publishing from dist directory
53- packageJson . main = './index.js'
54- packageJson . types = './index.d.ts'
45+ packageJson . main = './sdk/src/ index.js'
46+ packageJson . types = './sdk/src/ index.d.ts'
5547 packageJson . exports = {
5648 '.' : {
57- types : './index.d.ts' ,
58- import : './index.js' ,
59- default : './index.js'
49+ types : './sdk/src/ index.d.ts' ,
50+ import : './sdk/src/ index.js' ,
51+ default : './sdk/src/ index.js'
6052 }
6153 }
6254
Original file line number Diff line number Diff line change 11import { execFileSync } from 'child_process'
22
3- import { API_KEY_ENV_VAR } from '@codebuff/common/constants'
4-
3+ import { API_KEY_ENV_VAR } from '../../common/src/constants'
54import { CODEBUFF_BINARY } from './constants'
65import { processStream } from './process-stream'
76
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { spawn } from 'child_process'
22
33import { CODEBUFF_BINARY } from './constants'
44
5- import type { PrintModeEvent } from '@codebuff/ common/types/print-mode'
5+ import type { PrintModeEvent } from '../../ common/src /types/print-mode'
66
77export function processStream ( {
88 codebuffArgs,
@@ -35,15 +35,13 @@ export function processStream({
3535 child . stdout . on ( 'data' , onData )
3636 child . stderr . on ( 'data' , onData )
3737
38- const { promise , resolve, reject } = Promise . withResolvers < void > ( )
39-
40- child . on ( 'close' , ( code ) => {
41- if ( code === 0 ) {
42- resolve ( )
43- } else {
44- reject ( new Error ( `Codebuff exited with code ${ code } ` ) )
45- }
38+ return new Promise < void > ( ( resolve , reject ) => {
39+ child . on ( 'close' , ( code ) => {
40+ if ( code === 0 ) {
41+ resolve ( )
42+ } else {
43+ reject ( new Error ( `Codebuff exited with code ${ code } ` ) )
44+ }
45+ } )
4646 } )
47-
48- return promise
4947}
Original file line number Diff line number Diff line change 1- import type { PrintModeEvent } from '@codebuff/ common/types/print-mode'
2- import type { AgentTemplateType } from '@codebuff/ common/types/session-state'
1+ import type { PrintModeEvent } from '../../ common/src /types/print-mode'
2+ import type { AgentTemplateType } from '../../ common/src /types/session-state'
33
44export type CodebuffClientOptions = {
55 cwd : string
Original file line number Diff line number Diff line change 1212 "declaration" : true ,
1313 "declarationMap" : true ,
1414 "outDir" : " ./dist" ,
15- "rootDir" : " ./src" ,
1615 "allowImportingTsExtensions" : false ,
1716 "types" : [" node" ]
1817 },
You can’t perform that action at this time.
0 commit comments