Spaces:
Sleeping
Sleeping
File size: 946 Bytes
90cbf22 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
import { ObjectType } from 'convex/values';
import { playerInputs } from './player';
import { conversationInputs } from './conversation';
import { agentInputs } from './agentInputs';
// It's easy to hit circular dependencies with these imports,
// so assert at module scope so we hit errors when analyzing.
if (playerInputs === undefined || conversationInputs === undefined || agentInputs === undefined) {
throw new Error("Input map is undefined, check if there's a circular import.");
}
export const inputs = {
...playerInputs,
// Inputs for the messaging layer.
...conversationInputs,
// Inputs for the agent layer.
...agentInputs,
};
export type Inputs = typeof inputs;
export type InputNames = keyof Inputs;
export type InputArgs<Name extends InputNames> = ObjectType<Inputs[Name]['args']>;
export type InputReturnValue<Name extends InputNames> = ReturnType<
Inputs[Name]['handler']
> extends Promise<infer T>
? T
: never;
|