You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Changed main entrypoint js in package.json to be where it is now.
- If you know something is defined but TS doesn't, you can use the damnit flag, `!` instead of eslint ignore comments. `this.promise = new Promise(() => { .... this.process!.on('exit', ...)`
- `async function foo(): Promise<x> { return await bar() }` is redundant. This is functionally the same as just saying `function foo(): Promise<x> { return bar() }` but makes debugging harder. By marking the function async and awaiting you're creating an extra promise that does nothing but immediately resolve after bar's does. You don't have to declare your function as async in order for the consumer to be able to await it. The consumer just needs a function that returns a Promise (which bar() already returns). On your side you only have to say `async` if you want to use `await` for something in the body (other than just immediately returning it)
- Similarly text() and json() have that + a 2nd layer of extra promises. `throw` is the same as reject() and throws 'cascade' up so all json() needs to be is `return JSON.parse(await this.text())`. Also the returned JSON isn't necessarily an object, it could be an array or a random scalar so it should just return `any`.
- Changed default for a text block to just plain 'text' format, markdown will be a separate option (that the parser doesn't need to know about)
- Parameters (or ToolDef) should support globalTools and toolDefToString serializing them.
0 commit comments