MCPcopy Create free account
hub / github.com/pingdotgg/t3code / dispatchNormalizedCommand

Function dispatchNormalizedCommand

apps/server/src/ws.ts:884–905  ·  view source on GitHub ↗
(
        normalizedCommand: OrchestrationCommand,
      )

Source from the content-addressed store, hash-verified

882 });
883
884 const dispatchNormalizedCommand = (
885 normalizedCommand: OrchestrationCommand,
886 ): Effect.Effect<{ readonly sequence: number }, OrchestrationDispatchCommandError> => {
887 const dispatchEffect =
888 normalizedCommand.type === "thread.turn.start" && normalizedCommand.bootstrap
889 ? dispatchBootstrapTurnStart(normalizedCommand)
890 : orchestrationEngine
891 .dispatch(normalizedCommand)
892 .pipe(
893 Effect.mapError((cause) =>
894 toDispatchCommandError(cause, "Failed to dispatch orchestration command"),
895 ),
896 );
897
898 return startup
899 .enqueueCommand(dispatchEffect)
900 .pipe(
901 Effect.mapError((cause) =>
902 toDispatchCommandError(cause, "Failed to dispatch orchestration command"),
903 ),
904 );
905 };
906
907 const loadServerConfig = Effect.gen(function* () {
908 const keybindingsConfig = yield* keybindings.loadConfigState;

Callers 1

makeWsRpcLayerFunction · 0.85

Calls 2

toDispatchCommandErrorFunction · 0.85

Tested by

no test coverage detected