Skip to content

Commit

Permalink
Change prepublish script
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Jun 13, 2024
1 parent 8f18d35 commit ab920bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "tsc --noEmit",
"test": "vitest",
"example": "ts-node examples/helpers/runner.ts",
"prepublishOnly": "tsup src/index.ts --dts",
"prepublishOnly": "tsup src/index.ts --format cjs,esm --dts",
"changeset": "changeset",
"release": "changeset publish",
"version": "changeset version"
Expand Down
7 changes: 5 additions & 2 deletions src/planners/simplePlanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from '../types';
import { getAllTransitions } from '../utils';
import { AnyStateMachine } from 'xstate';
import { z } from 'zod';
import { defaultTextTemplate } from '../templates/defaultText';

function getTransitions(
Expand Down Expand Up @@ -75,9 +74,13 @@ export async function simplePlanner<T extends Agent<any>>(
for (const toolTransitionData of toolTransitions) {
const toolZodType = input.events?.[toolTransitionData.eventType];

if (!toolZodType) {
continue;
}

toolMap[toolTransitionData.name] = tool({
description: toolZodType?.description ?? toolTransitionData.description,
parameters: toolZodType ?? z.object({}),
parameters: toolZodType,
execute: async (params) => {
const event = {
type: toolTransitionData.eventType,
Expand Down
2 changes: 1 addition & 1 deletion src/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SomeZodObject } from 'zod';
import type { SomeZodObject } from 'zod';
import { AnyEventObject } from 'xstate';
import { ObservedState } from './types';

Expand Down

0 comments on commit ab920bd

Please sign in to comment.